Class: OpenHAB::Core::Events::AbstractEvent
- Inherits:
-
Object
- Object
- OpenHAB::Core::Events::AbstractEvent
- Defined in:
- lib/openhab/core/events/abstract_event.rb
Overview
Add attachments event data.
Direct Known Subclasses
AbstractItemChannelLinkRegistryEvent, AbstractItemRegistryEvent, AbstractThingRegistryEvent, ChannelTriggeredEvent, ItemEvent, StartlevelEvent, ThingStatusInfoChangedEvent, ThingStatusInfoEvent, TimerEvent
Instance Attribute Summary collapse
- #attachment ⇒ Object
- #inputs ⇒ Hash
-
#source ⇒ String
readonly
The component that sent the event.
Instance Method Summary collapse
- #inspect ⇒ String
-
#payload ⇒ Hash?
Returns the event payload as a Hash.
Instance Attribute Details
#attachment ⇒ Object
11 12 13 |
# File 'lib/openhab/core/events/abstract_event.rb', line 11 def @attachment end |
#inputs ⇒ Hash
14 15 16 |
# File 'lib/openhab/core/events/abstract_event.rb', line 14 def inputs @inputs end |
#source ⇒ String (readonly)
Returns The component that sent the event.
|
# File 'lib/openhab/core/events/abstract_event.rb', line 16
|
Instance Method Details
#inspect ⇒ String
31 32 33 34 35 |
# File 'lib/openhab/core/events/abstract_event.rb', line 31 def inspect s = "#<OpenHAB::Core::Events::#{self.class.simple_name} topic=#{topic} payload=#{payload.inspect}" s += " source=#{source.inspect}" if source "#{s}>" end |
#payload ⇒ Hash?
Returns the event payload as a Hash.
25 26 27 28 |
# File 'lib/openhab/core/events/abstract_event.rb', line 25 def payload require "json" @payload ||= JSON.parse(get_payload, symbolize_names: true) unless get_payload.empty? end |