Class: Parameter
- Inherits:
-
Object
- Object
- Parameter
- Defined in:
- lib/cfn-model/model/parameter.rb
Overview
copy-paste alert with ModelElement which should instead be Resource anyway
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#synthesized_value ⇒ Object
Returns the value of attribute synthesized_value.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #emit_instance_vars ⇒ Object
- #is_no_echo? ⇒ Boolean
-
#method_missing(method_name, *args) ⇒ Object
Treat any missing method as an instance variable get/set.
- #to_s ⇒ Object
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
24 25 26 27 28 29 30 |
# File 'lib/cfn-model/model/parameter.rb', line 24 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
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/cfn-model/model/parameter.rb', line 3 def id @id end |
#synthesized_value ⇒ Object
Returns the value of attribute synthesized_value.
5 6 7 |
# File 'lib/cfn-model/model/parameter.rb', line 5 def synthesized_value @synthesized_value end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/cfn-model/model/parameter.rb', line 3 def type @type end |
Instance Method Details
#emit_instance_vars ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/cfn-model/model/parameter.rb', line 32 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
7 8 9 |
# File 'lib/cfn-model/model/parameter.rb', line 7 def is_no_echo? !@noEcho.nil? && @noEcho.to_s.downcase == 'true' end |
#to_s ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cfn-model/model/parameter.rb', line 11 def to_s <<END { #{emit_instance_vars} } END end |