Class: Appdash::Event::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/appdash/event/base.rb

Overview

Base forms the most basic event type

Direct Known Subclasses

Log, Message, RackServer, SpanName

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema, attrs = {}) ⇒ Base

Returns a new instance of Base.

Parameters:

  • schema (String)

    the event schema name

  • attrs (Hash) (defaults to: {})

    event attributes



13
14
15
16
17
# File 'lib/appdash/event/base.rb', line 13

def initialize(schema, attrs = {})
  super()
  @schema = schema
  @attrs = attrs
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



9
10
11
# File 'lib/appdash/event/base.rb', line 9

def attrs
  @attrs
end

#schemaObject (readonly)

Returns the value of attribute schema.



9
10
11
# File 'lib/appdash/event/base.rb', line 9

def schema
  @schema
end

Instance Method Details

#to_aArray<Appdash::CollectPacket::Annotation>

Returns marshalable annotations.

Returns:



20
21
22
# File 'lib/appdash/event/base.rb', line 20

def to_a
  annotate(attrs) + [annotation(['_schema', schema].join(':'))]
end