Class: Manifold::Terraform::WorkspaceConfiguration

Inherits:
Configuration
  • Object
show all
Defined in:
lib/manifold/terraform/workspace_configuration.rb

Overview

Represents a Terraform configuration for a Manifold workspace.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Configuration

#write

Constructor Details

#initialize(name) ⇒ WorkspaceConfiguration

Returns a new instance of WorkspaceConfiguration.



169
170
171
172
173
174
# File 'lib/manifold/terraform/workspace_configuration.rb', line 169

def initialize(name)
  super()
  @name = name
  @vectors = []
  @dimensions_config = nil
end

Instance Attribute Details

#dimensions_config=(value) ⇒ Object (writeonly)

Sets the attribute dimensions_config

Parameters:

  • value

    the value to set the attribute dimensions_config to.



167
168
169
# File 'lib/manifold/terraform/workspace_configuration.rb', line 167

def dimensions_config=(value)
  @dimensions_config = value
end

#manifold_config=(value) ⇒ Object (writeonly)

Sets the attribute manifold_config

Parameters:

  • value

    the value to set the attribute manifold_config to.



167
168
169
# File 'lib/manifold/terraform/workspace_configuration.rb', line 167

def manifold_config=(value)
  @manifold_config = value
end

#nameObject (readonly)

Returns the value of attribute name.



166
167
168
# File 'lib/manifold/terraform/workspace_configuration.rb', line 166

def name
  @name
end

Instance Method Details

#add_vector(vector_config) ⇒ Object



176
177
178
# File 'lib/manifold/terraform/workspace_configuration.rb', line 176

def add_vector(vector_config)
  @vectors << vector_config
end

#as_jsonObject



180
181
182
183
184
185
186
187
188
189
# File 'lib/manifold/terraform/workspace_configuration.rb', line 180

def as_json
  {
    "variable" => variables_block,
    "resource" => {
      "google_bigquery_dataset" => dataset_config,
      "google_bigquery_table" => TableConfigBuilder.new(name, @manifold_config).build_table_configs,
      "google_bigquery_routine" => routine_config
    }.compact
  }
end