### Home Classes Methods

### In Files

- lib/termtter/memory_cache.rb

### Parent

Object

### Namespace

- CLASS Termtter::MemoryCache::MemCacheMock

### Methods

- #can_use_memcache?
- #method_missing
- #storage
- #storage_class

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Termtter
- Termtter::API
- Termtter::ActiveRubytter
- Termtter::Client
- Termtter::Client::UserSearchEvent
- Termtter::Command
- Termtter::CommandLine
- Termtter::Config
- Termtter::ConfigSetup
- Termtter::Crypt
- Termtter::Event
- Termtter::HTTPpool
- Termtter::Hook
- Termtter::HookCanceled
- Termtter::Hookable
- Termtter::JSONError
- Termtter::MemoryCache
- Termtter::MemoryCache::MemCacheMock
- Termtter::OptParser
- Termtter::Plugin
- Termtter::Plugin::Screen
- Termtter::Plugins
- Termtter::Plugins::Haml
- Termtter::RubytterProxy
- Termtter::RubytterProxy::FrequentAccessError
- Termtter::RubytterProxy::LimitManager
- Termtter::Status
- Termtter::Storage
- Termtter::Storage::Status
- Termtter::Task
- Termtter::TaskManager
- Termtter::UserStreamReceiver
- OAuth
- OAuth::AccessToken
- Array
- Growl
- IRB
- Object
- Readline
- Status
- String
- Symbol
- TermColor
- User

No matching classes.

# Termtter::MemoryCache

### Public Instance Methods

method_missing(method, *args, &block) click to toggle source

    # File lib/termtter/memory_cache.rb, line 12
    def method_missing(method, *args, &block)
      storage.__send__(method, *args, &block)
    end

storage() click to toggle source

delegate to storage class

    # File lib/termtter/memory_cache.rb, line 8
    def storage
      @storage ||= storage_class.new(config.cache.memcached_server)
    end

### Protected Instance Methods

can_use_memcache?() click to toggle source

    # File lib/termtter/memory_cache.rb, line 21
    def can_use_memcache?
      return unless config.cache.memcached_server
      begin
        require 'memcache'
        MemCache.new(config.cache.memcached_server).stats # when server is wrong, die here.
      rescue StandardError, LoadError
        false
      else
        true
      end
    end

storage_class() click to toggle source

    # File lib/termtter/memory_cache.rb, line 17
    def storage_class
      can_use_memcache? ? MemCache : MemCacheMock
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.