Class: Mongoid::Associations::Proxy
- Defined in:
- lib/mongoid/associations/proxy.rb
Overview
:nodoc
Direct Known Subclasses
BelongsToRelated, EmbeddedIn, EmbedsMany, EmbedsOne, HasManyRelated, HasOneRelated
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.
14 15 16 |
# File 'lib/mongoid/associations/proxy.rb', line 14 def method_missing(name, *args, &block) @target.send(name, *args, &block) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/mongoid/associations/proxy.rb', line 8 def @options end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
8 9 10 |
# File 'lib/mongoid/associations/proxy.rb', line 8 def target @target end |
Instance Method Details
#extends(options) ⇒ Object
If anonymous extensions are added this will take care of them.
19 20 21 |
# File 'lib/mongoid/associations/proxy.rb', line 19 def extends() extend Module.new(&.extension) if .extension? end |