Sha256: 5b3862752e105b09d6ecd208514dab2043a241d13c2e13b4ce87e4a3632a4f42

Contents?: true

Size: 503 Bytes

Versions: 178

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

# Helps build a list of conditional class names
module Ariadne
  # :nodoc:
  module ClassNameHelper
    def class_names(*args)
      [].tap do |classes|
        args.each do |class_name|
          next if class_name.blank?

          case class_name
          when String
            classes << class_name
          else
            raise ArgumentError, "Expected String class name, got #{class_name.class}"
          end
        end
      end.join(" ")
    end
  end
end

Version data entries

178 entries across 178 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.34 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-x86_64-linux app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-x86_64-darwin app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-x64-mingw32 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-x64-mingw-ucrt app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-arm64-darwin app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.34-aarch64-linux app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-x86_64-linux app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-x86_64-darwin app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-x64-mingw32 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-x64-mingw-ucrt app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-arm64-darwin app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.33-aarch64-linux app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32-x86_64-linux app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32-x86_64-darwin app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32-x64-mingw32 app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32-x64-mingw-ucrt app/lib/ariadne/class_name_helper.rb
ariadne_view_components-0.0.32-arm64-darwin app/lib/ariadne/class_name_helper.rb