Class: Impromptu::ComponentSet
- Inherits:
-
OrderedSet
- Object
- OrderedSet
- Impromptu::ComponentSet
- Defined in:
- lib/impromptu/component_set.rb
Instance Method Summary collapse
-
#[](name) ⇒ Object
Retrieve a component by name.
Methods inherited from OrderedSet
#<<, #delete, #each, #empty?, #include?, #initialize, #merge, #size, #to_a
Constructor Details
This class inherits a constructor from Impromptu::OrderedSet
Instance Method Details
#[](name) ⇒ Object
Retrieve a component by name. This is used very rarely (only in component definitions and the test suite) so a linear search is acceptable.
6 7 8 |
# File 'lib/impromptu/component_set.rb', line 6 def [](name) @items_list.select {|component| component.name == name}.first end |