Class: ReactiveObservers::Observable::Removing

Inherits:
Object
  • Object
show all
Defined in:
lib/reactive_observers/observable/removing.rb

Constant Summary collapse

REQUIRED_FIELDS =
%i[klass object].freeze

Instance Method Summary collapse

Constructor Details

#initialize(active_observers, observer, removing_options) ⇒ Removing

Returns a new instance of Removing.



8
9
10
11
12
# File 'lib/reactive_observers/observable/removing.rb', line 8

def initialize(active_observers, observer, removing_options)
  @active_observers = active_observers
  @observer = observer
  @removing_options = removing_options
end

Instance Method Details

#performObject



14
15
16
17
18
# File 'lib/reactive_observers/observable/removing.rb', line 14

def perform
  @active_observers.delete_if do |active_observer|
    active_observer.compare.partial? @observer, @removing_options
  end
end