Class: Terraspace::Terraform::Api::Vars::Rb

Inherits:
Base
  • Object
show all
Includes:
DslEvaluator
Defined in:
lib/terraspace/terraform/api/vars/rb.rb

Instance Method Summary collapse

Methods included from Util::Logging

#logger

Methods included from Http::Concern

#http

Constructor Details

#initializeRb

Returns a new instance of Rb.



5
6
7
8
# File 'lib/terraspace/terraform/api/vars/rb.rb', line 5

def initialize(*)
  super
  @vars = [] # holds results
end

Instance Method Details

#var(attrs = {}) ⇒ Object



15
16
17
18
19
# File 'lib/terraspace/terraform/api/vars/rb.rb', line 15

def var(attrs={})
  default = { category: "terraform" } # required field
  var = default.deep_merge(attrs).deep_stringify_keys!
  @vars << var
end

#varsObject



10
11
12
13
# File 'lib/terraspace/terraform/api/vars/rb.rb', line 10

def vars
  evaluate_file(@vars_path)
  @vars
end