Class: Glimmer::DataBinding::ObservableModel::Notifier

Inherits:
Object
  • Object
show all
Includes:
Glimmer::DataBinding::Observer
Defined in:
lib/glimmer/data_binding/observable_model.rb

Instance Method Summary collapse

Methods included from Glimmer::DataBinding::Observer

#add_dependent, #compact_args, #dependents, #dependents_for, #observe, proc, #registration_for, #registrations, #remove_dependent, #unobserve, #unobserve_all_observables, #unobserve_dependents_with_observable

Constructor Details

#initialize(observable_model, property_name) ⇒ Notifier

Returns a new instance of Notifier.


33
34
35
36
# File 'lib/glimmer/data_binding/observable_model.rb', line 33

def initialize(observable_model, property_name)
  @observable_model = observable_model
  @property_name = property_name
end

Instance Method Details

#call(new_value = nil, *extra_args) ⇒ Object


38
39
40
# File 'lib/glimmer/data_binding/observable_model.rb', line 38

def call(new_value=nil, *extra_args)
  @observable_model.notify_observers(@property_name)
end