Class: ReactiveObservers::Observable::Filtering
- Inherits:
-
Object
- Object
- ReactiveObservers::Observable::Filtering
- Defined in:
- lib/reactive_observers/observable/filtering.rb
Instance Method Summary collapse
-
#initialize(observed_object_id, observers, action, options) ⇒ Filtering
constructor
A new instance of Filtering.
- #perform ⇒ Object
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, ) @observed_object_id = observed_object_id @observers = observers @action = action @options = end |
Instance Method Details
#perform ⇒ Object
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 |