Class: Pangea::Resources::BaseComputedAttributes
- Defined in:
- lib/pangea/resources/reference.rb
Overview
Base computed attributes - common to all resources
Instance Attribute Summary collapse
-
#resource_ref ⇒ Object
readonly
Returns the value of attribute resource_ref.
Instance Method Summary collapse
-
#id ⇒ Object
Common terraform attributes available on all resources.
-
#initialize(resource_ref) ⇒ BaseComputedAttributes
constructor
A new instance of BaseComputedAttributes.
- #tags ⇒ Object
- #terraform_resource_name ⇒ Object
Constructor Details
#initialize(resource_ref) ⇒ BaseComputedAttributes
Returns a new instance of BaseComputedAttributes.
27 28 29 |
# File 'lib/pangea/resources/reference.rb', line 27 def initialize(resource_ref) @resource_ref = resource_ref end |
Instance Attribute Details
#resource_ref ⇒ Object (readonly)
Returns the value of attribute resource_ref.
25 26 27 |
# File 'lib/pangea/resources/reference.rb', line 25 def resource_ref @resource_ref end |
Instance Method Details
#id ⇒ Object
Common terraform attributes available on all resources
32 33 34 |
# File 'lib/pangea/resources/reference.rb', line 32 def id resource_ref.ref(:id) end |
#tags ⇒ Object
40 41 42 |
# File 'lib/pangea/resources/reference.rb', line 40 def resource_ref.resource_attributes[:tags] || {} end |
#terraform_resource_name ⇒ Object
36 37 38 |
# File 'lib/pangea/resources/reference.rb', line 36 def terraform_resource_name "#{resource_ref.type}.#{resource_ref.name}" end |