Class: Daneel::Data
- Inherits:
-
Object
- Object
- Daneel::Data
- Defined in:
- lib/daneel/data.rb
Overview
Non-persistent storage, extend if you want more.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize ⇒ Data
constructor
A new instance of Data.
- #rooms ⇒ Object
- #save ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize ⇒ Data
Returns a new instance of Data.
5 6 7 |
# File 'lib/daneel/data.rb', line 5 def initialize @store = {} end |
Instance Method Details
#[](key) ⇒ Object
13 14 15 |
# File 'lib/daneel/data.rb', line 13 def [](key) @store[key] end |
#[]=(key, value) ⇒ Object
17 18 19 |
# File 'lib/daneel/data.rb', line 17 def []=(key, value) @store[key] = value end |
#rooms ⇒ Object
25 26 27 |
# File 'lib/daneel/data.rb', line 25 def rooms @store["rooms"] ||= {} end |
#save ⇒ Object
9 10 11 |
# File 'lib/daneel/data.rb', line 9 def save # it's a hash, what do you want? end |
#users ⇒ Object
21 22 23 |
# File 'lib/daneel/data.rb', line 21 def users @store["users"] ||= {} end |