Class: Moneta::Proxy

### Home Classes Methods

### In Files

- lib/moneta/proxy.rb

### Parent

Object

### Methods

- ::new
- #clear
- #close
- #create
- #delete
- #features
- #increment
- #key?
- #load
- #store

### Included Modules

- Moneta::Defaults

### 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::MongoBase
- Moneta::Adapters::MongoMoped
- Moneta::Adapters::MongoOfficial
- 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.

# Moneta::Proxy

Proxy base class @api public

### Attributes

adapter[R]

### Public Class Methods

new(adapter, options = {}) click to toggle source

@param [Moneta store] adapter underlying adapter @param [Hash] options

    # File lib/moneta/proxy.rb, line 11
    def initialize(adapter, options = {})
      @adapter = adapter
    end

### Public Instance Methods

clear(options = {}) click to toggle source

Clear all keys in this store

@param [Hash] options @return [void] @api public

    # File lib/moneta/proxy.rb, line 83
    def clear(options = {})
      adapter.clear(options)
      self
    end

close() click to toggle source

(see Defaults#close)

    # File lib/moneta/proxy.rb, line 31
    def close
      adapter.close
    end

create(key, value, options = {}) click to toggle source

(see Defaults#create)

    # File lib/moneta/proxy.rb, line 26
    def create(key, value, options = {})
      adapter.create(key, value, options)
    end

delete(key, options = {}) click to toggle source

Delete the key from the store and return the current value

@param [Object] key @return [Object] current value @param [Hash] options @option options [Boolean] :raw Raw access without value transformation (See {Transformer}) @option options [String] :prefix Prefix key (See {Transformer}) @option options Other options as defined by the adapters or middleware @api public

    # File lib/moneta/proxy.rb, line 74
    def delete(key, options = {})
      adapter.delete(key, options)
    end

features() click to toggle source

(see Default#features)

    # File lib/moneta/proxy.rb, line 89
    def features
      @features ||= (self.class.features + adapter.features).uniq.freeze
    end

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

(see Defaults#increment)

    # File lib/moneta/proxy.rb, line 21
    def increment(key, amount = 1, options = {})
      adapter.increment(key, amount, options)
    end

key?(key, options = {}) click to toggle source

(see Defaults#key?)

    # File lib/moneta/proxy.rb, line 16
    def key?(key, options = {})
      adapter.key?(key, options)
    end

load(key, options = {}) click to toggle source

Fetch value with key. Return nil if the key doesn't exist

@param [Object] key @param [Hash] options @option options [Integer] :expires Update expiration time (See {Expires}) @option options [Boolean] :raw Raw access without value transformation (See {Transformer}) @option options [String] :prefix Prefix key (See {Transformer}) @option options [Boolean] :sync Synchronized load ({Cache} reloads from adapter, {Adapters::Daybreak} syncs with file) @option options Other options as defined by the adapters or middleware @return [Object] value @api public

    # File lib/moneta/proxy.rb, line 46
    def load(key, options = {})
      adapter.load(key, options)
    end

store(key, value, options = {}) click to toggle source

Store value with key

@param [Object] key @param [Object] value @param [Hash] options @option options [Integer] :expires Set expiration time (See {Expires}) @option options [Boolean] :raw Raw access without value transformation (See {Transformer}) @option options [String] :prefix Prefix key (See {Transformer}) @option options Other options as defined by the adapters or middleware @return value @api public

    # File lib/moneta/proxy.rb, line 61
    def store(key, value, options = {})
      adapter.store(key, value, options)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.