Class: YAML::DomainType
Constant Summary collapse
- CLOUDFORMATION_FUNCTION_REGEX =
%r[^(#{::Cfoo::CLOUDFORMATION_FUNCTIONS.join '|'})$]
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#type_id ⇒ Object
Returns the value of attribute type_id.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
12 13 14 |
# File 'lib/cfoo/yaml.rb', line 12 def domain @domain end |
#type_id ⇒ Object
Returns the value of attribute type_id.
12 13 14 |
# File 'lib/cfoo/yaml.rb', line 12 def type_id @type_id end |
#value ⇒ Object
Returns the value of attribute value.
12 13 14 |
# File 'lib/cfoo/yaml.rb', line 12 def value @value end |
Class Method Details
.create(type_id, value) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cfoo/yaml.rb', line 14 def self.create(type_id, value) type = self.allocate type.domain = "yaml.org,2002" type.type_id = type_id type.value = value type end |
Instance Method Details
#==(other) ⇒ Object
22 23 24 |
# File 'lib/cfoo/yaml.rb', line 22 def ==(other) eq? other end |
#eq?(other) ⇒ Boolean
26 27 28 29 30 31 32 |
# File 'lib/cfoo/yaml.rb', line 26 def eq?(other) if other.respond_to?(:domain) && other.respond_to?(:type_id) && other.respond_to?(:value) domain == other.domain && type_id == other.type_id && value == other.value else false end end |
#expand_el ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/cfoo/parser.rb', line 64 def case type_id when "Ref" { "Ref" => value. } when "GetAZs" if value.nil? { "Fn::GetAZs" => "" } else { "Fn::GetAZs" => value. } end when CLOUDFORMATION_FUNCTION_REGEX { "Fn::#{type_id}" => value. } when "Concat" { "Fn::Join" => ['', value.] } else super end end |