Method: JsonDiff.replace

Defined in:
lib/json-diff/operation.rb

.replace(path, before, after) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/json-diff/operation.rb', line 29

def self.replace(path, before, after)
  if before != nil
    {'op' => 'replace', 'path' => path, 'was' => before, 'value' => after}
  else
    {'op' => 'replace', 'path' => path, 'value' => after}
  end
end