class Controls::Event

A representation of the Event resource

Public Instance Methods

inspect() click to toggle source

Overrides inspect to use the proper event type

@return [String] the result of super with the corrected event type

Calls superclass method Dish::Plate#inspect
# File lib/controls/objects/event.rb, line 18
def inspect
  super.sub('Event', type)
end
payload() click to toggle source

Coerces the payload into the appropriate type

@return [Controls::SecurityControlChangeEventPayload,Controls::SiteChangeEventPayload,Controls::ProductEventPayload]

the payload respective of the event type
# File lib/controls/objects/event.rb, line 10
def payload
  value = _get_value('payload')
  Dish(value, Controls.const_get("#{type}Payload"))
end
to_s() click to toggle source

Returns the event type

todo
  • is the type all we want to return?

@return [string] the event type

# File lib/controls/objects/event.rb, line 27
def to_s
  type
end