Class: ConvenientService::Utils::Hash::TripleEqualityCompare Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Hash::TripleEqualityCompare
- Defined in:
- lib/convenient_service/utils/hash/triple_equality_compare.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #hash ⇒ Object readonly private
- #other_hash ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ Boolean private
- #initialize(hash, other_hash) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(hash, other_hash) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 40 |
# File 'lib/convenient_service/utils/hash/triple_equality_compare.rb', line 37 def initialize(hash, other_hash) @hash = hash @other_hash = other_hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/convenient_service/utils/hash/triple_equality_compare.rb', line 24 def hash @hash end |
#other_hash ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/convenient_service/utils/hash/triple_equality_compare.rb', line 30 def other_hash @other_hash end |
Instance Method Details
#call ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 48 49 50 |
# File 'lib/convenient_service/utils/hash/triple_equality_compare.rb', line 45 def call return false if hash.size != other_hash.size return false if hash.keys.difference(other_hash.keys).any? hash.all? { |key, value| value === other_hash[key] } end |