Class: TerraformConfig::Provider

Inherits:
Base
  • Object
show all
Defined in:
lib/core/terraform_config/provider.rb

Constant Summary

Constants included from Dsl

Dsl::EXPRESSION_PATTERN

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#importable?, #locals, #reference

Methods included from Dsl

#argument, #block

Constructor Details

#initialize(name:, **options) ⇒ Provider

Returns a new instance of Provider.



7
8
9
10
11
12
# File 'lib/core/terraform_config/provider.rb', line 7

def initialize(name:, **options)
  super()

  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/core/terraform_config/provider.rb', line 5

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/core/terraform_config/provider.rb', line 5

def options
  @options
end

Instance Method Details

#to_tfObject



14
15
16
17
18
19
20
# File 'lib/core/terraform_config/provider.rb', line 14

def to_tf
  block :provider, name do
    options.each do |option, value|
      argument option, value
    end
  end
end