Class: Trocla::Stores::Moneta
- Inherits:
-
Trocla::Store
- Object
- Trocla::Store
- Trocla::Stores::Moneta
- Defined in:
- lib/trocla/stores/moneta.rb
Overview
the default moneta based store
Instance Attribute Summary collapse
-
#moneta ⇒ Object
readonly
Returns the value of attribute moneta.
Attributes inherited from Trocla::Store
Instance Method Summary collapse
- #close ⇒ Object
- #get(key, format) ⇒ Object
-
#initialize(config, trocla) ⇒ Moneta
constructor
A new instance of Moneta.
Methods inherited from Trocla::Store
Constructor Details
#initialize(config, trocla) ⇒ Moneta
Returns a new instance of Moneta.
4 5 6 7 8 9 10 11 |
# File 'lib/trocla/stores/moneta.rb', line 4 def initialize(config,trocla) super(config,trocla) require 'moneta' # load expire support by default = { :expires => true }.merge( store_config['adapter_options']||{}) @moneta = Moneta.new(store_config['adapter'],) end |
Instance Attribute Details
#moneta ⇒ Object (readonly)
Returns the value of attribute moneta.
3 4 5 |
# File 'lib/trocla/stores/moneta.rb', line 3 def moneta @moneta end |
Instance Method Details
#close ⇒ Object
13 14 15 |
# File 'lib/trocla/stores/moneta.rb', line 13 def close moneta.close end |
#get(key, format) ⇒ Object
17 18 19 |
# File 'lib/trocla/stores/moneta.rb', line 17 def get(key,format) moneta.fetch(key, {})[format] end |