Class: Cfhighlander::Dsl::Parameters
- Inherits:
-
DslBase
- Object
- DslBase
- Cfhighlander::Dsl::Parameters
show all
- Defined in:
- lib/cfhighlander.dsl.params.rb
Overview
Instance Attribute Summary collapse
Attributes inherited from DslBase
#config
Instance Method Summary
collapse
-
#addParam(param) ⇒ Object
-
#ComponentParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String', allowedValues: nil) ⇒ Object
-
#initialize ⇒ Parameters
constructor
A new instance of Parameters.
-
#MappingParam(name, defaultValue = '', &block) ⇒ Object
-
#OutputParam(component:, name:, isGlobal: false, noEcho: false, type: 'String') ⇒ Object
-
#StackParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String') ⇒ Object
Methods inherited from DslBase
#FindInMap, #FnFindInMap, #FnGetAtt, #GetAtt, #Ref, #cfmap, #cfout, #method_missing
Constructor Details
12
13
14
|
# File 'lib/cfhighlander.dsl.params.rb', line 12
def initialize()
@param_list = []
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Cfhighlander::Dsl::DslBase
Instance Attribute Details
#param_list ⇒ Object
Returns the value of attribute param_list.
10
11
12
|
# File 'lib/cfhighlander.dsl.params.rb', line 10
def param_list
@param_list
end
|
Instance Method Details
#addParam(param) ⇒ Object
16
17
18
19
20
21
22
23
24
|
# 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
|
#ComponentParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String', allowedValues: nil) ⇒ Object
38
39
40
41
42
43
|
# File 'lib/cfhighlander.dsl.params.rb', line 38
def ComponentParam(name, defaultValue = '', isGlobal: false, noEcho: false, type: 'String', allowedValues: nil)
param = Parameter.new(name, type, defaultValue, noEcho, isGlobal, allowedValues)
param.config = @config
addParam param
return param
end
|
#MappingParam(name, defaultValue = '', &block) ⇒ Object
45
46
47
48
49
50
|
# File 'lib/cfhighlander.dsl.params.rb', line 45
def MappingParam(name, defaultValue = '', &block)
param = MappingParam.new(name, 'String', defaultValue)
param.config = @config
param.instance_eval(&block)
addParam param
end
|
#OutputParam(component:, name:, isGlobal: false, noEcho: false, type: 'String') ⇒ Object
31
32
33
34
35
36
|
# 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') ⇒ Object
26
27
28
29
|
# 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
|