Class: BetterHtml::Tree::AttributesList
- Inherits:
-
Object
- Object
- BetterHtml::Tree::AttributesList
- Defined in:
- lib/better_html/tree/attributes_list.rb
Class Method Summary collapse
Instance Method Summary collapse
- #[](name) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(list) ⇒ AttributesList
constructor
A new instance of AttributesList.
Constructor Details
#initialize(list) ⇒ AttributesList
Returns a new instance of AttributesList.
14 15 16 |
# File 'lib/better_html/tree/attributes_list.rb', line 14 def initialize(list) @list = list || [] end |
Class Method Details
Instance Method Details
#[](name) ⇒ Object
18 19 20 21 22 |
# File 'lib/better_html/tree/attributes_list.rb', line 18 def [](name) @list.find do |attribute| attribute.name == name.downcase end end |
#each(&block) ⇒ Object
24 25 26 |
# File 'lib/better_html/tree/attributes_list.rb', line 24 def each(&block) @list.each(&block) end |