Class: Compo::Composites::Leaf
- Inherits:
-
Object
- Object
- Compo::Composites::Leaf
- Includes:
- Composite
- Defined in:
- lib/compo/composites/leaf.rb
Overview
A Composite that cannot have children
Add/remove operations on a leaf composite always fail, and #children always returns the empty hash.
This is useful for leaf classes that still need to expose the composite API.
Direct Known Subclasses
Instance Method Summary collapse
-
#children ⇒ Hash
Returns the empty hash.
Methods included from Composite
#add, #get_child, #get_child_such_that, #remove, #remove_id
Instance Method Details
#children ⇒ Hash
Returns the empty hash
23 24 25 |
# File 'lib/compo/composites/leaf.rb', line 23 def children {} end |