Class: ActiveSupport::Cache::MonetaStore

### Home Classes Methods

### In Files

- lib/active_support/cache/moneta_store.rb

### Parent

Store

### Methods

- ::new
- #clear
- #decrement
- #delete_entry
- #increment
- #read_entry
- #write_entry

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Moneta
- Moneta::Adapters
- Moneta::Adapters::ActiveRecord
- Moneta::Adapters::Cassandra
- Moneta::Adapters::Client
- Moneta::Adapters::Cookie
- Moneta::Adapters::Couch
- Moneta::Adapters::DBM
- Moneta::Adapters::DataMapper
- Moneta::Adapters::DataMapper::Store
- Moneta::Adapters::Daybreak
- Moneta::Adapters::File
- Moneta::Adapters::Fog
- Moneta::Adapters::GDBM
- Moneta::Adapters::HBase
- Moneta::Adapters::KyotoCabinet
- Moneta::Adapters::LMDB
- Moneta::Adapters::LRUHash
- Moneta::Adapters::LRUHash::Entry
- Moneta::Adapters::LevelDB
- Moneta::Adapters::LocalMemCache
- Moneta::Adapters::MemcachedDalli
- Moneta::Adapters::MemcachedNative
- Moneta::Adapters::Memory
- Moneta::Adapters::Mongo
- Moneta::Adapters::Null
- Moneta::Adapters::PStore
- Moneta::Adapters::Redis
- Moneta::Adapters::RestClient
- Moneta::Adapters::Riak
- Moneta::Adapters::SDBM
- Moneta::Adapters::Sequel
- Moneta::Adapters::Sqlite
- Moneta::Adapters::TDB
- Moneta::Adapters::TokyoCabinet
- Moneta::Adapters::TokyoTyrant
- Moneta::Adapters::YAML
- Moneta::Builder
- Moneta::Cache
- Moneta::Cache::DSL
- Moneta::CreateSupport
- Moneta::Defaults
- Moneta::Defaults::ClassMethods
- Moneta::Expires
- Moneta::ExpiresSupport
- Moneta::HashAdapter
- Moneta::IncrementSupport
- Moneta::Lock
- Moneta::Logger
- Moneta::Logger::Format
- Moneta::Mutex
- Moneta::OptionMerger
- Moneta::OptionSupport
- Moneta::Pool
- Moneta::Proxy
- Moneta::Semaphore
- Moneta::Server
- Moneta::Shared
- Moneta::Stack
- Moneta::Stack::DSL
- Moneta::SynchronizePrimitive
- Moneta::Transformer
- Moneta::Transformer::Helper
- Moneta::Utils
- Moneta::WeakCreate
- Moneta::WeakIncrement
- Moneta::Wrapper
- Rack
- Rack::Cache
- Rack::Cache::EntityStore
- Rack::Cache::EntityStore::MONETA
- Rack::Cache::EntityStore::Moneta
- Rack::Cache::MetaStore
- Rack::Cache::MetaStore::MONETA
- Rack::Cache::MetaStore::Moneta
- Rack::Cache::MonetaResolver
- Rack::MonetaCookies
- Rack::MonetaRest
- Rack::MonetaStore
- Rack::Session
- Rack::Session::Moneta
- ActionDispatch
- ActionDispatch::Session
- ActionDispatch::Session::MonetaStore
- ActiveSupport
- ActiveSupport::Cache
- ActiveSupport::Cache::MonetaStore

No matching classes.

# ActiveSupport::Cache::MonetaStore

@api public

### Public Class Methods

new(options = nil) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 5
    def initialize(options = nil)
      raise ArgumentError, 'Option :store is required' unless @store = options.delete(:store)
      @store = ::Moneta.new(@store, :expires => true) if Symbol === @store
      super(options)
      extend Strategy::LocalCache
    end

### Public Instance Methods

clear(options = nil) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 26
    def clear(options = nil)
      options = merged_options(options)
      instrument(:clear, nil, nil) do
        @store.clear(moneta_options(options))
      end
    end

decrement(key, amount = 1, options = nil) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 19
    def decrement(key, amount = 1, options = nil)
      options = merged_options(options)
      instrument(:decrement, key, :amount => amount) do
        @store.increment(namespaced_key(key, options), -amount, moneta_options(options))
      end
    end

increment(key, amount = 1, options = nil) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 12
    def increment(key, amount = 1, options = nil)
      options = merged_options(options)
      instrument(:increment, key, :amount => amount) do
        @store.increment(namespaced_key(key, options), amount, moneta_options(options))
      end
    end

### Protected Instance Methods

delete_entry(key, options) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 45
    def delete_entry(key, options)
      @store.delete(key, moneta_options(options))
      true
    end

read_entry(key, options) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 35
    def read_entry(key, options)
      entry = @store.load(key, moneta_options(options))
      entry && (ActiveSupport::Cache::Entry === entry ? entry : ActiveSupport::Cache::Entry.new(entry))
    end

write_entry(key, entry, options) click to toggle source

    # File lib/active_support/cache/moneta_store.rb, line 40
    def write_entry(key, entry, options)
      @store.store(key, entry, moneta_options(options))
      true
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.