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.
162
163
164
165
|
# File 'lib/mongoid/clients/options.rb', line 162
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
175
176
177
178
179
180
181
182
183
184
|
# File 'lib/mongoid/clients/options.rb', line 175
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
190
191
192
|
# File 'lib/mongoid/clients/options.rb', line 190
def self.const_missing(name)
::Object.const_get(name)
end
|
Instance Method Details
#persistence_options ⇒ Object
167
168
169
|
# File 'lib/mongoid/clients/options.rb', line 167
def persistence_options
@options
end
|
#respond_to?(*args) ⇒ Boolean
171
172
173
|
# File 'lib/mongoid/clients/options.rb', line 171
def respond_to?(*args)
@target.respond_to?(*args)
end
|
#send(symbol, *args) ⇒ Object
186
187
188
|
# File 'lib/mongoid/clients/options.rb', line 186
def send(symbol, *args)
__send__(symbol, *args)
end
|