Sha256: 505021b31538f140f19dfa227eb72038355adaded79df2087e1c67f0dc26cb5d

Contents?: true

Size: 381 Bytes

Versions: 15

Compression:

Stored size: 381 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_html
      end

      def to_html
        to_a.join(" ")
      end

    end

  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
andrewroth_activeadmin-0.3.4.3 lib/active_admin/arbre/html/class_list.rb
andrewroth_activeadmin-0.3.4.2 lib/active_admin/arbre/html/class_list.rb
andrewroth_activeadmin-0.3.4.1 lib/active_admin/arbre/html/class_list.rb
andrewroth_activeadmin-0.3.4 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.3.4 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.3.3 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.3.2 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.3.1 lib/active_admin/arbre/html/class_list.rb
activeadmin-0.3.0 lib/active_admin/arbre/html/class_list.rb
nsm-activeadmin-0.2.2 lib/active_admin/arbre/class_list.rb
saulolso-activeadmin-0.2.2.1 lib/active_admin/arbre/class_list.rb
saulolso-activeadmin-0.2.2 lib/active_admin/arbre/class_list.rb
activeadmin-0.2.2 lib/active_admin/arbre/class_list.rb
activeadmin-0.2.1 lib/active_admin/arbre/class_list.rb
activeadmin-0.2.0 lib/active_admin/arbre/class_list.rb