Class: Arbre::HTML::ClassList
- Inherits:
-
Set
- Object
- Set
- Arbre::HTML::ClassList
- Defined in:
- lib/arbre/html/class_list.rb
Overview
Holds a set of classes
Class Method Summary collapse
Instance Method Summary collapse
- #add(class_names) ⇒ Object (also: #<<)
- #to_s ⇒ Object
Class Method Details
.build_from_string(class_names) ⇒ Object
9 10 11 |
# File 'lib/arbre/html/class_list.rb', line 9 def self.build_from_string(class_names) new.add(class_names) end |
Instance Method Details
#add(class_names) ⇒ Object Also known as: <<
13 14 15 16 17 18 |
# File 'lib/arbre/html/class_list.rb', line 13 def add(class_names) class_names.to_s.split(" ").each do |class_name| super(class_name) end self end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/arbre/html/class_list.rb', line 21 def to_s to_a.join(" ") end |