Class: TFDSL::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/tfdsl/stack.rb

Overview

This class is the representation of a terraform stack, or in another words is a collection of terraform configuration blocks

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Stack

Returns a new instance of Stack.



5
6
7
8
# File 'lib/tfdsl/stack.rb', line 5

def initialize(&block)
  @objects = []
  instance_eval(&block) if block_given?
end

Instance Method Details

#to_sObject



21
22
23
# File 'lib/tfdsl/stack.rb', line 21

def to_s
  @objects.each_with_object('') { |o, str| str << o }
end