Class: Jerakia::Cache
- Inherits:
-
Object
- Object
- Jerakia::Cache
- Defined in:
- lib/jerakia/cache.rb
Overview
Very primitive form of cache - but we'll make this smarter
Direct Known Subclasses
Instance Method Summary collapse
- #bucket ⇒ Object
- #bucket_add(index, data) ⇒ Object
- #in_bucket?(index) ⇒ Boolean
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
7 8 9 |
# File 'lib/jerakia/cache.rb', line 7 def initialize @@bucket = {} end |
Instance Method Details
#bucket ⇒ Object
20 21 22 |
# File 'lib/jerakia/cache.rb', line 20 def bucket @@bucket end |
#bucket_add(index, data) ⇒ Object
11 12 13 14 |
# File 'lib/jerakia/cache.rb', line 11 def bucket_add(index,data) @@bucket[index] = data data end |
#in_bucket?(index) ⇒ Boolean
16 17 18 |
# File 'lib/jerakia/cache.rb', line 16 def in_bucket?(index) @@bucket.has_key?(index) end |