Class: CloudFormer::Functions::GetAtt
- Inherits:
-
CloudFormer::Function
- Object
- CloudFormer::Function
- CloudFormer::Functions::GetAtt
- Defined in:
- lib/cloud_former/functions/get_att.rb
Instance Method Summary collapse
- #acts_as_string? ⇒ Boolean
- #dump_json ⇒ Object
-
#initialize(resource, attribute) ⇒ GetAtt
constructor
A new instance of GetAtt.
Constructor Details
#initialize(resource, attribute) ⇒ GetAtt
Returns a new instance of GetAtt.
5 6 7 8 |
# File 'lib/cloud_former/functions/get_att.rb', line 5 def initialize(resource, attribute) @resource = resource @attribute = attribute end |
Instance Method Details
#acts_as_string? ⇒ Boolean
10 11 12 |
# File 'lib/cloud_former/functions/get_att.rb', line 10 def acts_as_string? true end |
#dump_json ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cloud_former/functions/get_att.rb', line 14 def dump_json if @resource.respond_to?(:get_name) { 'Fn::GetAtt' => [@resource.get_name, @attribute] } elsif @resource.respond_to?(:to_s) { 'Fn::GetAtt' => [@resource.to_s, @attribute] } end end |