class Cfhighlander::Dsl::Parameters

dsl statements

Attributes

param_list[RW]

Public Class Methods

new() click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 12
def initialize()
  @param_list = []
end

Public Instance Methods

ComponentParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String', allowedValues: nil, allowedPattern: nil, maxLength: nil, maxValue: nil, minLength: nil, minValue: nil, description: nil, constraintDescription: nil) click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 38
def ComponentParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String', allowedValues: nil, allowedPattern: nil,
                    maxLength: nil, maxValue: nil, minLength: nil, minValue: nil, description: nil, constraintDescription: nil)
  param = Parameter.new(
    name: name,
    type: type,
    defaultValue: defaultValue,
    noEcho: noEcho,
    isGlobal: isGlobal,
    allowedValues: allowedValues,
    allowedPattern: allowedPattern,
    maxLength: maxLength,
    maxValue: maxValue,
    minLength: minLength,
    minValue: minValue,
    description: description,
    constraintDescription: constraintDescription
  )
  param.config = @config
  addParam param
  return param
end
MappingParam(name, defaultValue = '', &block) click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 60
def MappingParam(name, defaultValue = '', &block)
  param = MappingParam.new(
    name: name,
    type: 'String',
    defaultValue: defaultValue
  )
  param.config = @config
  param.instance_eval(&block)
  addParam param
end
OutputParam(component:, name:, isGlobal: false, noEcho: false, type: 'String') click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 31
def OutputParam(component:, name:, isGlobal: false, noEcho: false, type: 'String')
  STDERR.puts ("DEPRECATED: OutputParam #{name} - Use ComponentParam instead. Outputut params are " +
      "autorwired by name only, with component disregarded")
  param = ComponentParam(name, '', isGlobal: isGlobal, noEcho: noEcho, type: type)
  param.provided_value = "#{component}.#{name}"
end
StackParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String') click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 26
def StackParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String')
  STDERR.puts "DEPRECATED: StackParam #{name} - Use ComponentParam instead"
  ComponentParam(name, defaultValue, isGlobal: isGlobal, noEcho: noEcho, type: type)
end
addParam(param) click to toggle source
# File lib/cfhighlander.dsl.params.rb, line 16
def addParam(param)
  existing_param = @param_list.find {|p| p.name == param.name}
  if not existing_param.nil?
    puts "Parameter being overwritten. Updating parameter #{param.name} with new definition..."
    @param_list[@param_list.index(existing_param)] = param
  else
    @param_list << param
  end
end