class Burner::Library::Value::Nest

This job will nest the current value within a new outer hash. The specified key passed in will be the corresponding new hash key entry for the existing value.

Expected Payload input: anything. Payload output: hash.

Constants

DEFAULT_KEY

Attributes

key[R]

Public Class Methods

new(key: DEFAULT_KEY, name: '', register: Burner::DEFAULT_REGISTER) click to toggle source
Calls superclass method Burner::JobWithRegister::new
# 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

Public Instance Methods

perform(_output, payload) click to toggle source
# File lib/burner/library/value/nest.rb, line 31
def perform(_output, payload)
  payload[register] = { key => payload[register] }
end