Class: JSONP3::Patch::Op

Inherits:
Object
  • Object
show all
Defined in:
lib/json_p3/patch/op.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.



13
14
15
# File 'lib/json_p3/patch/op.rb', line 13

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

#nameObject

Return the name of the patch operation.



8
9
10
# File 'lib/json_p3/patch/op.rb', line 8

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

#to_hObject

Return a JSON-like representation of this patch operation.



18
19
20
# File 'lib/json_p3/patch/op.rb', line 18

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