Class: JSONPatcher::ArrayPatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/jsonpatcher/array_patcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ ArrayPatcher

Returns a new instance of ArrayPatcher.



3
4
5
# File 'lib/jsonpatcher/array_patcher.rb', line 3

def initialize(callable)
  @patcher = callable
end

Instance Method Details

#call(array) ⇒ Object



7
8
9
# File 'lib/jsonpatcher/array_patcher.rb', line 7

def call(array)
  array.map{ |e| @patcher.call(e) }
end