Class: TwitterTweetBot::Cache::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_tweet_bot/cache/store.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, provider) ⇒ Store

Returns a new instance of Store.



8
9
10
11
# File 'lib/twitter_tweet_bot/cache/store.rb', line 8

def initialize(name, provider)
  @name = name
  @provider = provider
end

Instance Method Details

#readObject



17
18
19
# File 'lib/twitter_tweet_bot/cache/store.rb', line 17

def read
  deserialize_value(provider.read(cache_key))
end

#write(value) ⇒ Object



13
14
15
# File 'lib/twitter_tweet_bot/cache/store.rb', line 13

def write(value)
  provider.write(cache_key, serialize_value(value))
end