Class: TeamboxThingsSync::Cache::BaseCache
- Inherits:
-
Object
- Object
- TeamboxThingsSync::Cache::BaseCache
- Defined in:
- lib/teambox-things-sync/cache/base_cache.rb
Direct Known Subclasses
Instance Method Summary collapse
- #[](id) ⇒ Object
-
#initialize(client, config = {}) ⇒ BaseCache
constructor
A new instance of BaseCache.
Constructor Details
#initialize(client, config = {}) ⇒ BaseCache
Returns a new instance of BaseCache.
5 6 7 8 9 |
# File 'lib/teambox-things-sync/cache/base_cache.rb', line 5 def initialize(client, config = {}) @data = {} @client = client @config = config end |
Instance Method Details
#[](id) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/teambox-things-sync/cache/base_cache.rb', line 11 def [](id) if @data[id].nil? @data[id] = query_api(id) end @data[id] end |