Module: Humanoid::Associations::Proxy::InstanceMethods
- Defined in:
- lib/humanoid/associations/proxy.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#extends(options) ⇒ Object
If anonymous extensions are added this will take care of them.
-
#method_missing(name, *args, &block) ⇒ Object
Default behavior of method missing should be to delegate all calls to the target of the proxy.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Default behavior of method missing should be to delegate all calls to the target of the proxy. This can be overridden in special cases.
20 21 22 |
# File 'lib/humanoid/associations/proxy.rb', line 20 def method_missing(name, *args, &block) @target.send(name, *args, &block) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/humanoid/associations/proxy.rb', line 14 def @options end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
14 15 16 |
# File 'lib/humanoid/associations/proxy.rb', line 14 def target @target end |
Instance Method Details
#extends(options) ⇒ Object
If anonymous extensions are added this will take care of them.
25 26 27 |
# File 'lib/humanoid/associations/proxy.rb', line 25 def extends() extend Module.new(&.extension) if .extension? end |