Module: Ariadne::ClassNameHelper

Included in:
Form::BaseComponent, Forms::Dsl::Input
Defined in:
app/lib/ariadne/class_name_helper.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#merge_class_names(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/lib/ariadne/class_name_helper.rb', line 7

def merge_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