Module: ActiveRecord::Chemistry::Actable::InstanceMethods
- Defined in:
- lib/activerecord/chemistry/actable/instance_methods.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/activerecord/chemistry/actable/instance_methods.rb', line 26
def method_missing(method, *args, &block)
if !self_respond_to?(method) && acting_as.respond_to?(method)
acting_as.send(method, *args, &block)
else
super
end
end
|
Instance Method Details
#respond_to?(name, include_private = false, as_original_class = false) ⇒ Boolean
14
15
16
17
18
19
20
|
# File 'lib/activerecord/chemistry/actable/instance_methods.rb', line 14
def respond_to?(name, include_private = false, as_original_class = false)
if as_original_class
super(name, include_private)
else
super(name, include_private) || acting_as.respond_to?(name)
end
end
|
#self_respond_to?(name, include_private = false) ⇒ Boolean
22
23
24
|
# File 'lib/activerecord/chemistry/actable/instance_methods.rb', line 22
def self_respond_to?(name, include_private = false)
respond_to? name, include_private, true
end
|