Class: Logtail::Events::TemplateRender
- Inherits:
-
Logtail::Event
- Object
- Logtail::Event
- Logtail::Events::TemplateRender
- Defined in:
- lib/logtail/events/template_render.rb
Instance Attribute Summary collapse
-
#duration_ms ⇒ Object
readonly
Returns the value of attribute duration_ms.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Logtail::Event
Instance Method Summary collapse
-
#initialize(attributes) ⇒ TemplateRender
constructor
A new instance of TemplateRender.
- #to_hash ⇒ Object
Methods inherited from Logtail::Event
#inspect, #to_json, #to_msgpack, #to_s
Constructor Details
#initialize(attributes) ⇒ TemplateRender
Returns a new instance of TemplateRender.
9 10 11 12 13 |
# File 'lib/logtail/events/template_render.rb', line 9 def initialize(attributes) @name = attributes[:name] @duration_ms = attributes[:duration_ms] @message = attributes[:message] end |
Instance Attribute Details
#duration_ms ⇒ Object (readonly)
Returns the value of attribute duration_ms.
7 8 9 |
# File 'lib/logtail/events/template_render.rb', line 7 def duration_ms @duration_ms end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/logtail/events/template_render.rb', line 7 def @message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/logtail/events/template_render.rb', line 7 def name @name end |
Instance Method Details
#to_hash ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/logtail/events/template_render.rb', line 15 def to_hash { template_rendered: Util::NonNilHashBuilder.build do |h| h.add(:name, name) h.add(:duration_ms, duration_ms) end } end |