Class: Moneta::Adapters::Memory

Inherits:
Object
  • Object
show all
Includes:
CreateSupport, Defaults, HashAdapter, IncrementSupport
Defined in:
lib/moneta/adapters/memory.rb

Overview

Memory backend using a hash to store the entries

Direct Known Subclasses

Cookie, DBM, Daybreak, GDBM, KyotoCabinet, LevelDB, SDBM, TDB, TokyoCabinet

Instance Attribute Summary

Attributes included from HashAdapter

#backend

Instance Method Summary collapse

Methods included from CreateSupport

#create, included

Methods included from IncrementSupport

included, #increment

Methods included from HashAdapter

#clear, #delete, #key?, #load, #store

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 = {}) ⇒ Memory

Returns a new instance of Memory

Parameters:

  • options (Hash) (defaults to: {})

    Options hash

Options Hash (options):

  • :backend (Hash)

    Use existing backend instance


13
14
15
# File 'lib/moneta/adapters/memory.rb', line 13

def initialize(options = {})
  @backend = options[:backend] || {}
end