lib/govuk_design_system_formbuilder/traits/html_classes.rb
def ruby_2_6_build_classes_fallback(*args)
        [].tap do |classes|
          args.each do |arg|
            if arg.is_a?(Hash)
              arg.each { |k, v| classes.append(k) if v }
            else
              classes.append(arg)
            end
          end
        end
      end
# combine all the classes in *args with any keys from **kwargs
# where the value is true. Roughly based on the behaviour from
# Rails' class_names, but recreated here as that returns a string
# where we want an array.
combine all the classes in *args with any keys from **kwargs
where the value is true. Roughly based on the behaviour from
Rails' class_names, but recreated here as that returns a string
where we want an array.
combine all the classes in * args with any keys from ** kwargs where the value is true . Roughly based on the behaviour from Rails ' class_names but recreated here as that returns a string where we want an array .
def ruby_2_6_build_classes_fallback(*args)
        [].tap do |classes|
          args.each do |arg|
            if arg.is_a?(Hash)
              arg.each { |k, v| classes.append(k) if v }
            else
              classes.append(arg)
            end
          end
        end
      end
def ruby_2_6_build_classes_fallback ( * args ) [ ] . tap do | classes | args . each do | arg | if arg . is_a? ( Hash ) arg . each { | k , v | classes . append ( k ) if v } else classes . append ( arg ) end end end end
combine all the classes in *args with any keys from **kwargs
where the value is true.
combine all the classes in * args with any keys from ** kwargs where the value is true .
args