Class: AngularSprinkles::Cache
- Inherits:
-
Object
- Object
- AngularSprinkles::Cache
- Defined in:
- lib/angular_sprinkles/cache.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
- #set(key, content = true) ⇒ Object
- #set?(key) ⇒ Boolean
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
3 4 5 |
# File 'lib/angular_sprinkles/cache.rb', line 3 def initialize @store = {} end |
Instance Method Details
#get(key) ⇒ Object
7 8 9 |
# File 'lib/angular_sprinkles/cache.rb', line 7 def get(key) @store[key] end |
#set(key, content = true) ⇒ Object
11 12 13 |
# File 'lib/angular_sprinkles/cache.rb', line 11 def set(key, content = true) @store[key] = content end |
#set?(key) ⇒ Boolean
15 16 17 |
# File 'lib/angular_sprinkles/cache.rb', line 15 def set?(key) @store.has_key?(key) end |