Class: Burner::Library::Value::Nest
- Inherits:
-
JobWithRegister
- Object
- Job
- JobWithRegister
- Burner::Library::Value::Nest
- Defined in:
- lib/burner/library/value/nest.rb
Overview
Constant Summary collapse
- DEFAULT_KEY =
'key'
Constants inherited from JobWithRegister
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Attributes inherited from JobWithRegister
Attributes inherited from Job
Instance Method Summary collapse
-
#initialize(key: DEFAULT_KEY, name: '', register: Burner::DEFAULT_REGISTER) ⇒ Nest
constructor
A new instance of Nest.
- #perform(_output, payload) ⇒ Object
Methods included from Util::Arrayable
Constructor Details
#initialize(key: DEFAULT_KEY, name: '', register: Burner::DEFAULT_REGISTER) ⇒ Nest
Returns a new instance of Nest.
23 24 25 26 27 28 29 |
# File 'lib/burner/library/value/nest.rb', line 23 def initialize(key: DEFAULT_KEY, name: '', register: Burner::DEFAULT_REGISTER) super(name: name, register: register) @key = key.to_s freeze end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
21 22 23 |
# File 'lib/burner/library/value/nest.rb', line 21 def key @key end |
Instance Method Details
#perform(_output, payload) ⇒ Object
31 32 33 |
# File 'lib/burner/library/value/nest.rb', line 31 def perform(_output, payload) payload[register] = { key => payload[register] } end |