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.



111
112
113
114
# File 'lib/mongoid/sessions/options.rb', line 111

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



124
125
126
127
128
129
# File 'lib/mongoid/sessions/options.rb', line 124

def method_missing(name, *args, &block)
 set_persistence_options(@target, @options)
 @target.send(name, *args, &block)
        ensure
 set_persistence_options(@target, nil)
end

Class Method Details

.const_missing(name) ⇒ Object



135
136
137
# File 'lib/mongoid/sessions/options.rb', line 135

def self.const_missing(name)
  ::Object.const_get(name)
end

Instance Method Details

#persistence_optionsObject



116
117
118
# File 'lib/mongoid/sessions/options.rb', line 116

def persistence_options
  @options
end

#respond_to?(*args) ⇒ Boolean

Returns:



120
121
122
# File 'lib/mongoid/sessions/options.rb', line 120

def respond_to?(*args)
  @target.respond_to?(*args)
end

#send(symbol, *args) ⇒ Object



131
132
133
# File 'lib/mongoid/sessions/options.rb', line 131

def send(symbol, *args)
  __send__(symbol, *args)
end