Class: NetuitiveD::IngestEvent
- Inherits:
-
Object
- Object
- NetuitiveD::IngestEvent
- Defined in:
- lib/netuitived/ingest_event.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#source ⇒ Object
Returns the value of attribute source.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(elementId, message, timestamp, title, level, source, type, tags) ⇒ IngestEvent
constructor
A new instance of IngestEvent.
- #to_json(_options = {}) ⇒ Object
Constructor Details
#initialize(elementId, message, timestamp, title, level, source, type, tags) ⇒ IngestEvent
Returns a new instance of IngestEvent.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/netuitived/ingest_event.rb', line 4 def initialize(elementId, , , title, level, source, type, ) @source = source @timestamp = @title = title @type = type @tags = @data = { 'elementId' => elementId, 'level' => level, 'message' => } end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def data @data end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def source @source end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def @tags end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def @timestamp end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/netuitived/ingest_event.rb', line 3 def type @type end |
Instance Method Details
#to_json(_options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/netuitived/ingest_event.rb', line 15 def to_json( = {}) millis = @timestamp.to_f * 1000 { 'source' => @source, 'timestamp' => millis.round, 'title' => @title, 'type' => @type, 'tags' => @tags, 'data' => @data }.to_json.tr('\\"', '"') end |