Sha256: 343fa9e68d939467308fc0f2d485df9404efbfd85259e0eb425d5dc7f419b76c

Contents?: true

Size: 336 Bytes

Versions: 11

Compression:

Stored size: 336 Bytes

Contents

require 'set'

module Arbre
  module HTML

    # Holds a set of classes
    class ClassList < Set

      def add(class_names)
        class_names.to_s.split(" ").each do |class_name|
          super(class_name)
        end
        self
      end
      alias :<< :add

      def to_s
        to_a.join(" ")
      end

    end

  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
arbre-1.0.0 lib/arbre/html/class_list.rb
arbre-1.0.0.rc4 lib/arbre/html/class_list.rb
arbre-1.0.0.rc3 lib/arbre/html/class_list.rb
arbre-1.0.0.rc2 lib/arbre/html/class_list.rb
arbre-1.0.0.rc1 lib/arbre/html/class_list.rb
activeadmin-0.4.4 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.4.3 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.4.2 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.4.1 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.4.0 lib/active_admin/arbre/html/class_list.rb
andrewroth_activeadmin-0.3.4.4 lib/active_admin/arbre/html/class_list.rb