Class: ReactiveObservers::Observer::ContainerComparator
- Inherits:
-
Object
- Object
- ReactiveObservers::Observer::ContainerComparator
- Defined in:
- lib/reactive_observers/observer/container_comparator.rb
Instance Method Summary collapse
- #full?(observer) ⇒ Boolean
-
#initialize(observer) ⇒ ContainerComparator
constructor
A new instance of ContainerComparator.
- #partial?(observer, options) ⇒ Boolean
Constructor Details
#initialize(observer) ⇒ ContainerComparator
Returns a new instance of ContainerComparator.
6 7 8 |
# File 'lib/reactive_observers/observer/container_comparator.rb', line 6 def initialize(observer) @observer = observer end |
Instance Method Details
#full?(observer) ⇒ Boolean
18 19 20 21 22 23 24 25 |
# File 'lib/reactive_observers/observer/container_comparator.rb', line 18 def full?(observer) partial?(observer.observer, fields: observer.fields, on: observer.on, constrain: observer.constrain) && @observer.observed == observer.observed && @observer.trigger == observer.trigger && @observer.notify == observer.notify && @observer.refine == observer.refine && @observer.only == observer.only end |
#partial?(observer, options) ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/reactive_observers/observer/container_comparator.rb', line 10 def partial?(observer, ) @observer.observer == observer && array_compare_of(@observer.fields, [:fields]) && array_compare_of(@observer.on, [:on]) && context_compare_with([:context]) && constrain_compare_with([:constrain]) end |