Class: Mongoid::Clients::Options::Proxy
- Inherits:
-
BasicObject
- Includes:
- Threaded
- Defined in:
- lib/mongoid/clients/options.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(target, options) ⇒ Proxy
Returns a new instance of Proxy.
156
157
158
159
|
# File 'lib/mongoid/clients/options.rb', line 156
def initialize(target, options)
@target = target
@options = options
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
169
170
171
172
173
174
175
176
177
178
|
# File 'lib/mongoid/clients/options.rb', line 169
def method_missing(name, *args, &block)
set_persistence_options(@target, @options)
ret = @target.send(name, *args, &block)
if Mongoid::Criteria == ret.class
ret.with @options
end
ret
ensure
set_persistence_options(@target, nil)
end
|
Class Method Details
.const_missing(name) ⇒ Object
184
185
186
|
# File 'lib/mongoid/clients/options.rb', line 184
def self.const_missing(name)
::Object.const_get(name)
end
|
Instance Method Details
#persistence_options ⇒ Object
161
162
163
|
# File 'lib/mongoid/clients/options.rb', line 161
def persistence_options
@options
end
|
#respond_to?(*args) ⇒ Boolean
165
166
167
|
# File 'lib/mongoid/clients/options.rb', line 165
def respond_to?(*args)
@target.respond_to?(*args)
end
|
#send(symbol, *args) ⇒ Object
180
181
182
|
# File 'lib/mongoid/clients/options.rb', line 180
def send(symbol, *args)
__send__(symbol, *args)
end
|