Class: Ecoportal::API::Common::Content::DoubleModel::Diffable::PatchDiffService

Inherits:
Object
  • Object
show all
Includes:
HashDiffPatch
Defined in:
lib/ecoportal/api/common/content/double_model/diffable/patch_diff_service.rb

Constant Summary

Constants included from HashDiffPatch

HashDiffPatch::META_KEYS, HashDiffPatch::NO_CHANGES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashDiffPatch::InstanceMethods

#patch_diff

Methods included from Ecoportal::API::Common::Content::DocHelpers

#array_id_index, #array_id_item, #array_ids, #get_body, #get_id

Constructor Details

#initialize(subject) ⇒ PatchDiffService

Returns a new instance of PatchDiffService.



7
8
9
# File 'lib/ecoportal/api/common/content/double_model/diffable/patch_diff_service.rb', line 7

def initialize(subject)
  @subject = subject
end

Instance Attribute Details

#subjectObject (readonly)

Returns the value of attribute subject.



5
6
7
# File 'lib/ecoportal/api/common/content/double_model/diffable/patch_diff_service.rb', line 5

def subject
  @subject
end

Instance Method Details

#diffObject



11
12
13
14
15
16
# File 'lib/ecoportal/api/common/content/double_model/diffable/patch_diff_service.rb', line 11

def diff
  patch_diff(
    curr_doc,
    prev_doc
  )
end