Class: Mongoid::Clients::Options::Proxy
- Inherits:
-
BasicObject
- Includes:
- Threaded
- Defined in:
- lib/mongoid/clients/options.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Threaded
#client_with_options
Constructor Details
#initialize(target, options) ⇒ Proxy
Returns a new instance of Proxy.
269
270
271
272
|
# File 'lib/mongoid/clients/options.rb', line 269
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
282
283
284
285
286
287
288
289
290
291
|
# File 'lib/mongoid/clients/options.rb', line 282
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
unset_persistence_options(@target)
end
|
Class Method Details
.const_missing(name) ⇒ Object
297
298
299
|
# File 'lib/mongoid/clients/options.rb', line 297
def self.const_missing(name)
::Object.const_get(name)
end
|
Instance Method Details
#persistence_options ⇒ Object
274
275
276
|
# File 'lib/mongoid/clients/options.rb', line 274
def persistence_options
@options
end
|
#respond_to?(*args) ⇒ Boolean
278
279
280
|
# File 'lib/mongoid/clients/options.rb', line 278
def respond_to?(*args)
@target.respond_to?(*args)
end
|
#send(symbol, *args) ⇒ Object
293
294
295
|
# File 'lib/mongoid/clients/options.rb', line 293
def send(symbol, *args)
__send__(symbol, *args)
end
|