Class: Rash
Instance Method Summary collapse
-
#[](key) ⇒ Hash, ...
Retrieves the value for a given key.
-
#[]=(key, value) ⇒ Object
Store the given value with the given key, either an an argument or block.
-
#initialize(url, path) ⇒ Object
constructor
Initializes a new store object.
-
#keys ⇒ Array<String, Symbol>
return all keys in the store as an array.
-
#size ⇒ Fixnum
return the size of the store as an integer.
Methods included from Memoizable
Constructor Details
Instance Method Details
#[](key) ⇒ Hash, ...
Retrieves the value for a given key
46 47 48 |
# File 'lib/hoodie/rash.rb', line 46 def [](key) @store[key] end |
#[]=(key, value) ⇒ Object
Store the given value with the given key, either an an argument or block. If a previous value was set it will be overwritten with the new value.
60 61 62 |
# File 'lib/hoodie/rash.rb', line 60 def []=(key, value) @store[key] = value end |
#keys ⇒ Array<String, Symbol>
return all keys in the store as an array
76 77 78 |
# File 'lib/hoodie/rash.rb', line 76 def keys @store.keys end |
#size ⇒ Fixnum
return the size of the store as an integer
68 69 70 |
# File 'lib/hoodie/rash.rb', line 68 def size @store.size end |