Module: Mongoid::Clients::Options::ClassMethods
- Includes:
- Threaded
- Defined in:
- lib/mongoid/clients/options.rb
Instance Method Summary
collapse
Methods included from Threaded
#client_with_options, #persistence_options
Instance Method Details
#client_name ⇒ Object
207
208
209
210
211
212
|
# File 'lib/mongoid/clients/options.rb', line 207
def client_name
if persistence_options && v = persistence_options[:client]
return v.to_sym
end
super
end
|
#collection_name ⇒ Object
214
215
216
217
218
219
|
# File 'lib/mongoid/clients/options.rb', line 214
def collection_name
if persistence_options && v = persistence_options[:collection]
return v.to_sym
end
super
end
|
#database_name ⇒ Object
221
222
223
224
225
226
|
# File 'lib/mongoid/clients/options.rb', line 221
def database_name
if persistence_options && v = persistence_options[:database]
return v.to_sym
end
super
end
|
#with(options) ⇒ Class
Tell the next persistence operation to store in a specific collection, database or client.
252
253
254
255
256
257
258
259
260
|
# File 'lib/mongoid/clients/options.rb', line 252
def with(options)
if block_given?
set_options(self, options)
yield self
unset_options(self)
else
Proxy.new(self, (persistence_options || {}).merge(options))
end
end
|