Class: Moneta::Adapters::MongoBase Private

Inherits:
Object
  • Object
show all
Includes:
Defaults, ExpiresSupport
Defined in:
lib/moneta/adapters/mongo/base.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

MongoMoped, MongoOfficial

Constant Summary collapse

DEFAULT_PORT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

27017

Instance Attribute Summary collapse

Attributes included from ExpiresSupport

#default_expires

Instance Method Summary collapse

Methods included from Defaults

#[], #[]=, #close, #create, #decrement, #features, #fetch, included, #increment, #key?, #supports?

Methods included from OptionSupport

#expires, #prefix, #raw, #with

Constructor Details

#initialize(options = {}) ⇒ MongoBase

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of MongoBase.



13
14
15
16
17
18
# File 'lib/moneta/adapters/mongo/base.rb', line 13

def initialize(options = {})
  self.default_expires = options.delete(:expires)
  @expires_field = options.delete(:expires_field) || 'expiresAt'
  @value_field = options.delete(:value_field) || 'value'
  @type_field = options.delete(:type_field) || 'type'
end

Instance Attribute Details

#backendObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/moneta/adapters/mongo/base.rb', line 9

def backend
  @backend
end