Class: Parameter

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

Constant Summary collapse

ELEMENTS =
[
  :name,
  :type,
  :default,
  :description,
  :allowed_values,
  :allowed_pattern,
  :no_echo,
  :max_length,
  :min_length,
  :max_value,
  :min_value,
  :constraint_description
]

Instance Method Summary collapse

Constructor Details

#initialize(name, cfn_hash) ⇒ Parameter

Returns a new instance of Parameter.



20
21
22
23
24
25
26
# File 'lib/parameter.rb', line 20

def initialize(name, cfn_hash)
  @name = name
  ELEMENTS.each do |e|
    key_name = e.to_s.camel_case
    instance_variable_set('@' + e.to_s, cfn_hash[key_name]) if cfn_hash[key_name]
  end
end