Class: Burner::Library::Value::Static

Inherits:
JobWithRegister show all
Defined in:
lib/burner/library/value/static.rb

Overview

Arbitrarily set the value of a register.

Expected Payload input: anything. Payload output: whatever value was specified in this job.

Constant Summary

Constants inherited from JobWithRegister

JobWithRegister::BLANK

Instance Attribute Summary collapse

Attributes inherited from JobWithRegister

#register

Attributes inherited from Job

#name

Instance Method Summary collapse

Methods included from Util::Arrayable

#array

Constructor Details

#initialize(name: '', register: DEFAULT_REGISTER, value: nil) ⇒ Static

Returns a new instance of Static.



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

def initialize(name: '', register: DEFAULT_REGISTER, value: nil)
  super(name: name, register: register)

  @value = value

  freeze
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18
19
20
# File 'lib/burner/library/value/static.rb', line 18

def value
  @value
end

Instance Method Details

#perform(_output, payload) ⇒ Object



28
29
30
# File 'lib/burner/library/value/static.rb', line 28

def perform(_output, payload)
  payload[register] = value
end