Class: JSONPatcher::ElementPatcher
- Inherits:
-
Object
- Object
- JSONPatcher::ElementPatcher
- Defined in:
- lib/jsonpatcher/element_patcher.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ ElementPatcher
constructor
A new instance of ElementPatcher.
- #patch(element) ⇒ Object
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 |