Class: JSONP3::Op

Inherits:
Object
  • Object
show all
Defined in:
lib/json_p3/patch.rb

Overview

Base class for all JSON Patch operations

Direct Known Subclasses

OpAdd, OpCopy, OpMove, OpRemove, OpReplace, OpTest

Instance Method Summary collapse

Instance Method Details

#apply(_value, _index) ⇒ Object

Apply the patch operation to value.



15
16
17
# File 'lib/json_p3/patch.rb', line 15

def apply(_value, _index)
  raise "JSON Patch operations must implement apply(value, index)"
end

#nameObject

Return the name of the patch operation.



10
11
12
# File 'lib/json_p3/patch.rb', line 10

def name
  raise "JSON Patch operations must implement #name"
end

#to_hObject

Return a JSON-like representation of this patch operation.



20
21
22
# File 'lib/json_p3/patch.rb', line 20

def to_h
  raise "JSON Patch operations must implement #to_h"
end