Class: Pangea::Resources::Base::ResourceDefinition

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

Overview

Resource definition that gets passed to terraform-synthesizer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, attributes) ⇒ ResourceDefinition

Returns a new instance of ResourceDefinition.



27
28
29
30
31
# File 'lib/pangea/resources/base.rb', line 27

def initialize(type, name, attributes)
  @type = type
  @name = name
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



25
26
27
# File 'lib/pangea/resources/base.rb', line 25

def attributes
  @attributes
end

#nameObject (readonly)

Returns the value of attribute name.



25
26
27
# File 'lib/pangea/resources/base.rb', line 25

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



25
26
27
# File 'lib/pangea/resources/base.rb', line 25

def type
  @type
end

Instance Method Details

#to_terraform_resource(&block) ⇒ Object

Convert to terraform-synthesizer resource block



34
35
36
# File 'lib/pangea/resources/base.rb', line 34

def to_terraform_resource(&block)
  resource(type, name, &block)
end