Class: Glimmer::DataBinding::ObservableHash::Notifier

Inherits:
Object
  • Object
show all
Includes:
Glimmer::DataBinding::Observer
Defined in:
lib/glimmer/data_binding/observable_hash.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, key) ⇒ Notifier

Returns a new instance of Notifier.


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

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

Instance Method Details

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


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

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