Module: TFW::CreateStackMethods

Included in:
StackMethods
Defined in:
lib/tfw/stack_methods.rb

Overview

Dynamically create stack methods

Instance Method Summary collapse

Instance Method Details

#create_stack_methodsObject



6
7
8
9
10
11
# File 'lib/tfw/stack_methods.rb', line 6

def create_stack_methods
  stack = TFW::State.instance.stack
  %w[provider variable locals tfmodule datasource resource output terraform].each do |name|
    define_method(name) { |*args, &block| stack.method(name).call(*args, &block) }
  end
end