Class: Gauge::DataStore
- Inherits:
-
Object
- Object
- Gauge::DataStore
- Defined in:
- lib/datastore.rb
Instance Method Summary collapse
- #clear ⇒ Object private
-
#get(key) ⇒ object
Fetches the object corresponding to the given key.
-
#initialize ⇒ DataStore
constructor
private
A new instance of DataStore.
-
#put(key, value) ⇒ Object
Stores the object against the given key.
Constructor Details
#initialize ⇒ DataStore
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of DataStore.
23 24 25 |
# File 'lib/datastore.rb', line 23 def initialize clear end |
Instance Method Details
#clear ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/datastore.rb', line 42 def clear @data_map = Hash.new end |
#get(key) ⇒ object
Fetches the object corresponding to the given key
30 31 32 |
# File 'lib/datastore.rb', line 30 def get(key) @data_map[key] end |
#put(key, value) ⇒ Object
Stores the object against the given key
37 38 39 |
# File 'lib/datastore.rb', line 37 def put(key, value) @data_map[key] = value end |