Module: Switcher::Object
- Defined in:
- lib/switcher/adapters/object.rb
Defined Under Namespace
Modules: ClassMethods, Initializer
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
49
50
51
52
53
|
# File 'lib/switcher/adapters/object.rb', line 49
def self.included(base)
base.extend Switcher::ClassMethods
base.extend Switcher::Object::Initializer
base.extend Switcher::Object::ClassMethods
end
|
Instance Method Details
#switch(event, *args) ⇒ Object
55
56
57
|
# File 'lib/switcher/adapters/object.rb', line 55
def switch(event, *args)
switch_from(self.class, event, *args)
end
|
#switch_from(orig, event, *args) ⇒ Object
59
60
61
62
63
|
# File 'lib/switcher/adapters/object.rb', line 59
def switch_from(orig, event, *args)
self.class.class_variable_get(:@@__specs__).each do |spc|
self.instance_variable_get(:"@#{spc.name}_statement").publish(event, orig, args)
end
end
|