Method: Hashformer::Generate::Chain#call

Defined in:
lib/hashformer/generate.rb

#call(input_hash) ⇒ Object

Applies the methods stored by #method_missing



195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/hashformer/generate.rb', line 195

def call(input_hash)
  value = input_hash
  @calls.each do |c|
    if c[:name]
      value = value.send(c[:name], *c[:args], &c[:block])
    else
      # Support #__as
      value = c[:block].call(value, *c[:args])
    end
  end
  value
end