Module: JsonDiff::Helpers::ClassMethods

Defined in:
lib/jsondiff/helpers.rb

Instance Method Summary collapse

Instance Method Details

#add_op(prefix, key, value) ⇒ Object



8
9
10
# File 'lib/jsondiff/helpers.rb', line 8

def add_op(prefix, key, value)
  {op: :add, path: "#{prefix}/#{key}", value: value}
end

#remove_op(prefix, key) ⇒ Object



12
13
14
# File 'lib/jsondiff/helpers.rb', line 12

def remove_op(prefix, key)
  {op: :remove, path: "#{prefix}/#{key}"}
end

#replace_op(prefix, value) ⇒ Object



16
17
18
# File 'lib/jsondiff/helpers.rb', line 16

def replace_op(prefix, value)
  {op: :replace, path: prefix, value: value}
end