Class: RZWaveWay::Event

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/rzwaveway/events.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Event

Returns a new instance of Event.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/rzwaveway/events.rb', line 5

def initialize(hash)
  raise ArgumentError, 'Hash can not be nil' unless hash
  raise ArgumentError, 'Missing device_id' unless hash.has_key? :device_id
  hash[:time] = Time.now.to_i unless hash.has_key? :time

  super(hash)
end