Class: JSONPatcher::ElementPatcher

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

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ ElementPatcher

Returns a new instance of ElementPatcher.



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

def initialize(&block)
  @patcher = block
end

Instance Method Details

#patch(element) ⇒ Object



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

def patch(element)
  @patcher.call(element)
end