Module: Ecoportal::API::Common::Content::DoubleModel::Diffable
- Extended by:
- Includer
- Included in:
- Ecoportal::API::Common::Content::DoubleModel
- Defined in:
- lib/ecoportal/api/common/content/double_model/diffable.rb,
lib/ecoportal/api/common/content/double_model/diffable/patch_diff_service.rb
Defined Under Namespace
Classes: PatchDiffService
Constant Summary collapse
- DIFF_CLASS =
PatchDiffService
Instance Method Summary collapse
-
#as_update ⇒ nil, Hash
The patch
Hashmodel including only the changes betweenoriginal_docanddoc. -
#dirty? ⇒ Boolean
Stating if there are changes.
Methods included from Includer
Instance Method Details
#as_update ⇒ nil, Hash
Returns the patch Hash model including only
the changes between original_doc and doc.
27 28 29 |
# File 'lib/ecoportal/api/common/content/double_model/diffable.rb', line 27 def as_update diff_class.new(self).diff end |
#dirty? ⇒ Boolean
Returns stating if there are changes.
32 33 34 35 36 37 38 |
# File 'lib/ecoportal/api/common/content/double_model/diffable.rb', line 32 def dirty? au = as_update return false if au.nil? return false if au == {} true end |