Class: JSONPatcher::ArrayPatcher
- Inherits:
-
Object
- Object
- JSONPatcher::ArrayPatcher
- Defined in:
- lib/jsonpatcher/array_patcher.rb
Instance Method Summary collapse
- #call(array) ⇒ Object
-
#initialize(callable) ⇒ ArrayPatcher
constructor
A new instance of ArrayPatcher.
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 |