### 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

- ChangeLog
- README.rdoc

### Class/Module Index

Quicksearch

- Termtter
- Termtter::API
- Termtter::ActiveRubytter
- Termtter::Client
- Termtter::Client::DirectMessage
- Termtter::Client::Jakigan
- Termtter::Client::SearchEvent
- Termtter::Client::UserSearchEvent
- Termtter::Command
- Termtter::CommandCanceled
- Termtter::CommandLine
- Termtter::CommandNotFound
- Termtter::Config
- Termtter::ConfigSetup
- Termtter::Crypt
- Termtter::English
- 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::Plugins::ListSwitch
- Termtter::RubytterProxy
- Termtter::RubytterProxy::FrequentAccessError
- Termtter::RubytterProxy::LimitManager
- Termtter::Status
- Termtter::StdOut
- Termtter::Storage
- Termtter::Storage::SQLite3
- Termtter::Storage::Status
- Termtter::Task
- Termtter::TaskManager
- Termtter::TypableIdGenerator
- Termtter::UserStreamReceiver
- Yharian
- Yharian::Alex
- Yharian::Jenifer
- Yharian::Remark
- Yharian::Speaker
- Yharian::Vicki
- Yharian::Yhara
- HatenaKeywordHaiku
- HatenaKeywordHaiku::Word
- OAuth
- OAuth::AccessToken
- Readline
- Readline::LIBREADLINE
- AAMaker
- Array
- BrowserNotFound
- Growl
- IRB
- Object
- Status
- String
- Symbol
- TermColor
- TermtterIrcGateway
- 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.