Class: Aqueductron::CompoundResult
- Inherits:
-
Object
- Object
- Aqueductron::CompoundResult
- Includes:
- Result
- Defined in:
- lib/aqueductron/compound_result.rb
Instance Method Summary collapse
-
#initialize(paths) ⇒ CompoundResult
constructor
A new instance of CompoundResult.
- #keys ⇒ Object
- #value(*path) ⇒ Object
Methods included from Result
Constructor Details
#initialize(paths) ⇒ CompoundResult
Returns a new instance of CompoundResult.
4 5 6 |
# File 'lib/aqueductron/compound_result.rb', line 4 def initialize(paths) @contents = paths end |
Instance Method Details
#keys ⇒ Object
8 9 10 |
# File 'lib/aqueductron/compound_result.rb', line 8 def keys @contents.keys end |
#value(*path) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/aqueductron/compound_result.rb', line 12 def value(*path) return self if path.empty? (head, *tail) = path puts "Nothing found at #{head}" unless @contents[head] @contents[head].value(*tail) end |