Class: Daneel::Data

Inherits:
Object
  • Object
show all
Defined in:
lib/daneel/data.rb

Overview

Non-persistent storage, extend if you want more.

Instance Method Summary collapse

Constructor Details

#initializeData

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

#roomsObject



25
26
27
# File 'lib/daneel/data.rb', line 25

def rooms
  @store["rooms"] ||= {}
end

#saveObject



9
10
11
# File 'lib/daneel/data.rb', line 9

def save
  # it's a hash, what do you want?
end

#usersObject



21
22
23
# File 'lib/daneel/data.rb', line 21

def users
  @store["users"] ||= {}
end