Class: LogSnag::Log
Overview
Constructs and validates an event log
Constant Summary collapse
- REQUIRED_KEYS =
%i[project channel event].freeze
- ALLOWED_KEYS =
REQUIRED_KEYS + %i[ user_id description icon notify tags parser timestamp ].freeze
Instance Attribute Summary
Attributes inherited from EventBase
Instance Method Summary collapse
-
#initialize(data, config) ⇒ LogSnag::Insight
constructor
Creates a new Log object.
Methods inherited from EventBase
Constructor Details
#initialize(data, config) ⇒ LogSnag::Insight
Creates a new Log object. The data hash must include the following keys:
- :channel [String] The channel within the project to which the log belongs.
- :event [String] The name of the event.
The data hash may include the following keys:
- :user_id [String] The user ID of the user to be identified.
- :description [String] The description of the event.
- :icon [String] The icon to be displayed with the event.
- :notify [Boolean] Whether or not to send a push notification for the event.
- :tags [Hash] The tags to be associated with the event.
- :parser [String] The parser to be used for the event. One of "text" or "markdown".
- :timestamp [Numeric] The timestamp of the event (in Unix seconds).
33 34 35 36 37 38 39 |
# File 'lib/logsnag/log.rb', line 33 def initialize(data, config) super(data, config) append_required_fields! validate_data end |