Class: Burner::Library::Echo

Inherits:
Job
  • Object
show all
Defined in:
lib/burner/library/echo.rb

Overview

Output a simple message to the output.

Note: this does not use Payload#registers.

Instance Attribute Summary collapse

Attributes inherited from Job

#name

Instance Method Summary collapse

Methods included from Util::Arrayable

#array

Constructor Details

#initialize(message: '', name: '') ⇒ Echo

Returns a new instance of Echo.



18
19
20
21
22
23
24
# File 'lib/burner/library/echo.rb', line 18

def initialize(message: '', name: '')
  super(name: name)

  @message = message.to_s

  freeze
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



16
17
18
# File 'lib/burner/library/echo.rb', line 16

def message
  @message
end

Instance Method Details

#perform(output, payload) ⇒ Object



26
27
28
29
30
# File 'lib/burner/library/echo.rb', line 26

def perform(output, payload)
  compiled_message = job_string_template(message, output, payload)

  output.detail(compiled_message)
end