Class: Ecoportal::API::Common::GraphQL::Model::Diffable::ClassicDiffService

Inherits:
Object
  • Object
show all
Includes:
HashDiffNesting
Defined in:
lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb

Direct Known Subclasses

DiffService

Constant Summary

Constants included from HashDiffNesting

HashDiffNesting::META_KEYS, HashDiffNesting::NO_CHANGES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashDiffNesting::InstanceMethods

#change_diff

Constructor Details

#initialize(subject, ignore: []) ⇒ ClassicDiffService

Returns a new instance of ClassicDiffService.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
# File 'lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb', line 7

def initialize(subject, ignore: [])
  msg  = 'Expecting Ecoportal::API::Common::Content::DoubleModel. '
  msg << "Given: #{subject.class}"
  raise ArgumentError, msg unless subject.is_a?(Ecoportal::API::Common::Content::DoubleModel)

  @subject  = subject
  @ignored  = to_a(ignore)
end

Instance Attribute Details

#subjectObject (readonly)

Returns the value of attribute subject.



5
6
7
# File 'lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb', line 5

def subject
  @subject
end

Instance Method Details

#diff(ignore: []) ⇒ Object



16
17
18
# File 'lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb', line 16

def diff(ignore: [])
  classic_diff(ignore: ignore)
end