Class: Mongoid::Sessions::Options::Proxy
- Inherits:
-
BasicObject
- Includes:
- Threaded
- Defined in:
- lib/mongoid/sessions/options.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(target, options) ⇒ Proxy
Returns a new instance of Proxy.
146
147
148
149
|
# File 'lib/mongoid/sessions/options.rb', line 146
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
159
160
161
162
163
164
165
166
167
168
|
# File 'lib/mongoid/sessions/options.rb', line 159
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
174
175
176
|
# File 'lib/mongoid/sessions/options.rb', line 174
def self.const_missing(name)
::Object.const_get(name)
end
|
Instance Method Details
#persistence_options ⇒ Object
151
152
153
|
# File 'lib/mongoid/sessions/options.rb', line 151
def persistence_options
@options
end
|
#respond_to?(*args) ⇒ Boolean
155
156
157
|
# File 'lib/mongoid/sessions/options.rb', line 155
def respond_to?(*args)
@target.respond_to?(*args)
end
|
#send(symbol, *args) ⇒ Object
170
171
172
|
# File 'lib/mongoid/sessions/options.rb', line 170
def send(symbol, *args)
__send__(symbol, *args)
end
|