Sha256: fed6ff22923e9c55e56364accee05ddedbc08620172461f54797375018caca6a

Contents?: true

Size: 655 Bytes

Versions: 68

Compression:

Stored size: 655 Bytes

Contents

# frozen_string_literal: true

require 'eac_config/node'
require 'eac_templates/variable_providers/base'

module EacTemplates
  module VariableProviders
    class ConfigReader < ::EacTemplates::VariableProviders::Base
      class << self
        def accept?(variables_source)
          return false unless variables_source.respond_to?(:entry)

          entry = variables_source.entry(:any_value)
          entry.respond_to?(:value) && entry.respond_to?(:found?)
        end
      end

      def variable_exist?(name)
        source.entry(name).found?
      end

      def variable_fetch(name)
        source.entry(name).value
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 4 rubygems

Version Path
eac_templates-0.3.2 lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.129.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.16.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.128.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.15.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.14.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.13.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.127.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.12.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.126.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.11.1 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.125.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.11.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.124.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.10.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.123.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.9.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
avm-tools-0.122.0 sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.8.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb
eac_tools-0.7.0 sub/avm-tools/sub/eac_templates/lib/eac_templates/variable_providers/config_reader.rb