Class: Pangea::Resources::BaseComputedAttributes

Inherits:
Object
  • Object
show all
Defined in:
lib/pangea/resources/reference.rb

Overview

Base computed attributes - common to all resources

Instance Attribute Summary collapse

Instance Method Summary collapse

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_refObject (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

#idObject

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

#tagsObject



40
41
42
# File 'lib/pangea/resources/reference.rb', line 40

def tags
  resource_ref.resource_attributes[:tags] || {}
end

#terraform_resource_nameObject



36
37
38
# File 'lib/pangea/resources/reference.rb', line 36

def terraform_resource_name
  "#{resource_ref.type}.#{resource_ref.name}"
end