Class: Burner::Library::IO::Read

Inherits:
OpenFileBase show all
Defined in:
lib/burner/library/io/read.rb

Overview

Read value from disk.

Expected Payload input: nothing. Payload output: contents of the specified file.

Constant Summary

Constants inherited from JobWithRegister

JobWithRegister::BLANK

Instance Attribute Summary

Attributes inherited from OpenFileBase

#binary, #disk, #path

Attributes inherited from JobWithRegister

#register

Attributes inherited from Job

#name

Instance Method Summary collapse

Methods inherited from OpenFileBase

#initialize

Methods inherited from JobWithRegister

#initialize

Methods inherited from Job

#initialize

Methods included from Util::Arrayable

#array

Constructor Details

This class inherits a constructor from Burner::Library::IO::OpenFileBase

Instance Method Details

#perform(output, payload) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/burner/library/io/read.rb', line 20

def perform(output, payload)
  compiled_path = job_string_template(path, output, payload)

  output.detail("Reading: #{compiled_path}")

  payload[register] = disk.read(compiled_path, binary: binary)
end