Class: Aqueductron::CompoundResult

Inherits:
Object
  • Object
show all
Includes:
Result
Defined in:
lib/aqueductron/compound_result.rb

Instance Method Summary collapse

Methods included from Result

#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

#keysObject



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