Class: Compo::Composites::Hash
- Inherits:
-
Object
- Object
- Compo::Composites::Hash
- Extended by:
- Forwardable
- Includes:
- Composite
- Defined in:
- lib/compo/composites/hash.rb
Overview
Implementation of Composite that stores its children in a Hash.
IDs for items entering a ListComposite may be any permissible hash.
Adding an item at an occupied ID removes the occupant.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#children ⇒ Hash
readonly
Returns the hash composite’s children, as a Hash.
Instance Method Summary collapse
-
#initialize ⇒ Hash
constructor
Initialises a hash composite.
Methods included from Composite
#add, #get_child, #get_child_such_that, #remove, #remove_id
Constructor Details
#initialize ⇒ Hash
Initialises a hash composite
20 21 22 |
# File 'lib/compo/composites/hash.rb', line 20 def initialize @children = {} end |
Instance Attribute Details
#children ⇒ Hash (readonly)
Returns the hash composite’s children, as a Hash
35 36 37 |
# File 'lib/compo/composites/hash.rb', line 35 def children @children end |