Class: Reducer

Inherits:
Object show all
Defined in:
lib/white_gold/abi/reducer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reduction, &block) ⇒ Reducer

Returns a new instance of Reducer.



2
3
4
5
# File 'lib/white_gold/abi/reducer.rb', line 2

def initialize reduction, &block
  @reduction = reduction
  @block = block
end

Instance Attribute Details

#reductionObject (readonly)

Returns the value of attribute reduction.



11
12
13
# File 'lib/white_gold/abi/reducer.rb', line 11

def reduction
  @reduction
end

Instance Method Details

#call(*a) ⇒ Object



7
8
9
# File 'lib/white_gold/abi/reducer.rb', line 7

def call *a
  block.call *a
end