Class: Mailkube::Events::Event

Inherits:
Node
  • Object
show all
Defined in:
lib/mailkube/events/envelopes.rb,
sig/mailkube/events/envelopes.rbs

Overview

data is declared per concrete subclass rather than on Event, which is what lets UnknownEvent#data return a raw Hash without conflicting with a typed sibling.

There is no id: the delivery id travels in the X-Webhook-Id header.

Instance Attribute Summary

Attributes inherited from Node

#raw

Instance Method Summary collapse

Methods inherited from Node

#==, #[], #block, #hash, #initialize, #to_h

Constructor Details

This class inherits a constructor from Mailkube::Events::Node

Instance Method Details

#created_atString

Returns when the event occurred.

Returns:

  • (String)

    when the event occurred.



17
# File 'lib/mailkube/events/envelopes.rb', line 17

def created_at = self["created_at"]

#typeString

Returns the event type, e.g. email.delivered.

Returns:

  • (String)

    the event type, e.g. email.delivered.



15
16
# File 'lib/mailkube/events/envelopes.rb', line 15

def type = self["type"]
# @return [String] when the event occurred.