Class: Controls::Event

Inherits:
Dish::Plate
  • Object
show all
Defined in:
lib/controls/objects/event.rb

Overview

A representation of the Event resource

Instance Method Summary collapse

Instance Method Details

#inspectString

Overrides #inspect to use the proper event type

Returns:

  • (String)

    the result of super with the corrected event type



18
19
20
# File 'lib/controls/objects/event.rb', line 18

def inspect
  super.sub('Event', type)
end

#payloadControls::SecurityControlChangeEventPayload, ...

Coerces the payload into the appropriate type

Returns:



10
11
12
13
# File 'lib/controls/objects/event.rb', line 10

def payload
  value = _get_value('payload')
  Dish(value, Controls.const_get("#{type}Payload"))
end

#to_sstring

Returns the event type

todo
  • is the type all we want to return?

Returns:

  • (string)

    the event type



27
28
29
# File 'lib/controls/objects/event.rb', line 27

def to_s
  type
end