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, #each_key, #features, #fetch, #fetch_values, included, #increment, #key?, #merge!, #slice, #supports?, #values_at

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


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

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.


11
12
13
# File 'lib/moneta/adapters/mongo/base.rb', line 11

def backend
  @backend
end