Class: Domotics::Core::DataHash
- Defined in:
- lib/domotics/core/data/data_hash.rb
Instance Method Summary collapse
- #[](obj) ⇒ Object
- #get(key) ⇒ Object
-
#initialize ⇒ DataHash
constructor
A new instance of DataHash.
- #set(key, value) ⇒ Object
Constructor Details
#initialize ⇒ DataHash
Returns a new instance of DataHash.
3 4 5 |
# File 'lib/domotics/core/data/data_hash.rb', line 3 def initialize @store = {} end |
Instance Method Details
#[](obj) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/domotics/core/data/data_hash.rb', line 7 def [](obj) case obj when Element DataHashOperator.new self, "#{obj.room.name}:#{obj.name}" end end |
#get(key) ⇒ Object
17 18 19 |
# File 'lib/domotics/core/data/data_hash.rb', line 17 def get(key) @store[key] end |
#set(key, value) ⇒ Object
14 15 16 |
# File 'lib/domotics/core/data/data_hash.rb', line 14 def set(key, value) @store[key] = value end |