Class: RZWaveWay::Event
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- RZWaveWay::Event
- Defined in:
- lib/rzwaveway/events.rb
Direct Known Subclasses
AlarmEvent, AliveDevice, BatteryValueEvent, DeadDevice, InactiveDevice, LevelEvent
Instance Method Summary collapse
-
#initialize(hash) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(hash) ⇒ Event
Returns a new instance of Event.
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 |