Class: Funk::Result

Inherits:
Delegator
  • Object
show all
Defined in:
lib/funk/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instruments) ⇒ Result

Returns a new instance of Result.



7
8
9
10
11
12
# File 'lib/funk/result.rb', line 7

def initialize(instruments)
  @instruments = instruments.each_with_object({}) do |inst, obj|
    obj[inst.class.name.split("::").last] = inst
  end
  @result = {}
end

Instance Attribute Details

#instrumentsObject (readonly)

Returns the value of attribute instruments.



5
6
7
# File 'lib/funk/result.rb', line 5

def instruments
  @instruments
end

Instance Method Details

#__getobj__Object

delegate all other methods to @result hash



15
16
17
# File 'lib/funk/result.rb', line 15

def __getobj__
  @result
end