Sha256: bd4bc2a47ea5a27f60d42bf27f380f2a8d2a45a12a99aead092fb66650eabd7c

Contents?: true

Size: 511 Bytes

Versions: 3

Compression:

Stored size: 511 Bytes

Contents

module Terraspace::Compiler
  class Expander
    delegate :expand, :expand_string, to: :expander

    attr_reader :expander
    def initialize(mod, name)
      @mod, @name = mod, name
      @expander = expander_class.new(@mod)
    end

    def expander_class
      # IE: TerraspacePluginAws::Interfaces::Expander
      klass_name = Terraspace::Plugin.klass("Expander", backend: @name)
      klass_name.constantize if klass_name
    rescue NameError
      Terraspace::Plugin::Expander::Generic
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
terraspace-0.1.2 lib/terraspace/compiler/expander.rb
terraspace-0.1.1 lib/terraspace/compiler/expander.rb
terraspace-0.1.0 lib/terraspace/compiler/expander.rb