Class: Roast::Log::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/log.rb

Overview

A log message paired with its originating type, so downstream handlers (e.g. the formatter) can render or route it by type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, text:) ⇒ Message

: (type: Symbol, text: String) -> void



34
35
36
37
# File 'lib/roast/log.rb', line 34

def initialize(type:, text:)
  @type = type
  @text = text
end

Instance Attribute Details

#textObject (readonly)

: String



31
32
33
# File 'lib/roast/log.rb', line 31

def text
  @text
end

#typeObject (readonly)

: Symbol



28
29
30
# File 'lib/roast/log.rb', line 28

def type
  @type
end

Instance Method Details

#to_sObject

: () -> String



40
41
42
# File 'lib/roast/log.rb', line 40

def to_s
  text
end