Sha256: 2c09f542993bd9cde7aa4115b74ab539780f1f354180e95aef45c53d85640f2d

Contents?: true

Size: 565 Bytes

Versions: 8

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EacTemplates
  module VariableProviders
    require_sub __FILE__

    PROVIDERS = %w[entries_reader hash generic].map do |name|
      "eac_templates/variable_providers/#{name}".camelize.constantize
    end

    class << self
      def build(variables_source)
        PROVIDERS.each do |provider|
          return provider.new(variables_source) if provider.accept?(variables_source)
        end

        raise "Variables provider not found for #{variables_source}"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
avm-tools-0.102.2 vendor/eac_templates/lib/eac_templates/variable_providers.rb
avm-tools-0.102.1 vendor/eac_templates/lib/eac_templates/variable_providers.rb
avm-tools-0.102.0 vendor/eac_templates/lib/eac_templates/variable_providers.rb
avm-tools-0.101.0 vendor/eac_templates/lib/eac_templates/variable_providers.rb
avm-tools-0.100.0 vendor/eac_templates/lib/eac_templates/variable_providers.rb
avm-tools-0.99.1 vendor/eac_templates/lib/eac_templates/variable_providers.rb
eac_templates-0.1.0 lib/eac_templates/variable_providers.rb
avm-tools-0.99.0 vendor/eac_templates/lib/eac_templates/variable_providers.rb