Class: ReactiveObservers::Observable::Filtering

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

Instance Method Summary collapse

Constructor Details

#initialize(observed_object_id, observers, action, options) ⇒ Filtering

Returns a new instance of Filtering.



6
7
8
9
10
11
# File 'lib/reactive_observers/observable/filtering.rb', line 6

def initialize(observed_object_id, observers, action, options)
  @observed_object_id = observed_object_id
  @observers = observers
  @action = action
  @options = options
end

Instance Method Details

#performObject



13
14
15
16
17
# File 'lib/reactive_observers/observable/filtering.rb', line 13

def perform
  @observers.select do |observer|
    filter_action(observer) && filter_record_constrains(observer) && filter_fields(observer)
  end
end