Class: Brandmaker::JobConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/brandmaker/job_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(technical_name, variables = []) ⇒ JobConfig

Returns a new instance of JobConfig.



6
7
8
9
# File 'lib/brandmaker/job_config.rb', line 6

def initialize technical_name, variables = []
  @technical_name = technical_name
  @variables = variables
end

Instance Attribute Details

#technical_nameObject

Returns the value of attribute technical_name.



3
4
5
# File 'lib/brandmaker/job_config.rb', line 3

def technical_name
  @technical_name
end

#variablesObject

Returns the value of attribute variables.



4
5
6
# File 'lib/brandmaker/job_config.rb', line 4

def variables
  @variables
end

Instance Method Details

#add_variables(*vars) ⇒ Object



11
12
13
14
15
16
# File 'lib/brandmaker/job_config.rb', line 11

def add_variables *vars
  vars.each_with_index do |var, index|
    hash = var.is_a?(Hash) ? var : { :name => var }
    variables << VariableConfig.new(hash)
  end
end