Class: Armada::Observer

Inherits:
ActiveModel::Observer
  • Object
show all
Defined in:
lib/armada/observer.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObserver

Returns a new instance of Observer.



8
9
10
11
# File 'lib/armada/observer.rb', line 8

def initialize
  super
  observed_subclasses.each { |klass| add_observer!(klass) }
end

Class Method Details

.method_added(method) ⇒ Object



13
14
15
# File 'lib/armada/observer.rb', line 13

def self.method_added(method)
  self.observed_methods += [method] if Armada::Callbacks::CALLBACKS.include?(method.to_sym)
end