module TFW::CreateStackMethods

Dynamically create stack methods

Public Instance Methods

create_stack_methods() click to toggle source
# 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