Class: Burner::JobWithDynamicKeys

Inherits:
JobWithRegister show all
Defined in:
lib/burner/job_with_dynamic_keys.rb

Overview

Add on a register attribute to the configuration for a job. This indicates that a job either accesses and/or mutates the payload’s registers.

Constant Summary

Constants inherited from JobWithRegister

Burner::JobWithRegister::BLANK

Instance Attribute Summary collapse

Attributes inherited from JobWithRegister

#register

Attributes inherited from Job

#name

Instance Method Summary collapse

Methods inherited from Job

#perform

Methods included from Util::Arrayable

#array

Constructor Details

#initialize(keys_register:, name: '', register: DEFAULT_REGISTER, separator: BLANK, key_mappings: []) ⇒ JobWithDynamicKeys

Returns a new instance of JobWithDynamicKeys.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/burner/job_with_dynamic_keys.rb', line 20

def initialize(
  keys_register:,
  name: '',
  register: DEFAULT_REGISTER,
  separator: BLANK,
  key_mappings: []
)
  super(name: name, register: register)

  @key_mappings  = Modeling::KeyMapping.array(key_mappings)
  @keys_register = keys_register.to_s
  @resolver      = Objectable.resolver(separator: separator)

  freeze
end

Instance Attribute Details

#key_mappingsObject (readonly)

Returns the value of attribute key_mappings.



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

def key_mappings
  @key_mappings
end

#keys_registerObject (readonly)

Returns the value of attribute keys_register.



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

def keys_register
  @keys_register
end

#resolverObject (readonly)

Returns the value of attribute resolver.



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

def resolver
  @resolver
end