Class: Parameter

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

Overview

copy-paste alert with ModelElement which should instead be Resource anyway

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object

Treat any missing method as an instance variable get/set

This will allow arbitrary elements in Resource/Properties definitions to map to instance variables without having to anticipate them in a schema



26
27
28
29
30
31
32
# File 'lib/cfn-model/model/parameter.rb', line 26

def method_missing(method_name, *args)
  if method_name =~ /^(\w+)=$/
    instance_variable_set "@#{$1}", args[0]
  else
    instance_variable_get "@#{method_name}"
  end
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/cfn-model/model/parameter.rb', line 5

def id
  @id
end

#synthesized_valueObject

Returns the value of attribute synthesized_value.



7
8
9
# File 'lib/cfn-model/model/parameter.rb', line 7

def synthesized_value
  @synthesized_value
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/cfn-model/model/parameter.rb', line 5

def type
  @type
end

Instance Method Details

#emit_instance_varsObject



34
35
36
37
38
39
40
# File 'lib/cfn-model/model/parameter.rb', line 34

def emit_instance_vars
  instance_vars_str = ''
  self.instance_variables.each do |instance_variable|
    instance_vars_str += "  #{instance_variable}=#{instance_variable_get(instance_variable)}\n"
  end
  instance_vars_str
end

#is_no_echo?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/cfn-model/model/parameter.rb', line 9

def is_no_echo?
  !@noEcho.nil? && @noEcho.to_s.downcase == 'true'
end

#to_sObject



13
14
15
16
17
18
19
# File 'lib/cfn-model/model/parameter.rb', line 13

def to_s
  <<END
{
#{emit_instance_vars}
}
END
end