Sha256: fa81a0daaf7dadfd219e6345419d0a0fb549bc5f37374087e2c5bb39f276f8ca

Contents?: true

Size: 587 Bytes

Versions: 4

Compression:

Stored size: 587 Bytes

Contents

module Inferno
  module DSL
    module FHIREvaluation
      class Config
        DEFAULT_FILE = File.join(__dir__, 'default.yml')
        attr_accessor :data

        # To-do: add config_file as arguments
        def initialize(config_file = nil)
          @data = if config_file.nil?
                    YAML.load_file(File.absolute_path(DEFAULT_FILE))
                  else
                    YAML.load_file(File.absolute_path(config_file))
                  end

          raise(TypeError, 'Malformed configuration') unless @data.is_a?(Hash)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
inferno_core-0.6.1 lib/inferno/dsl/fhir_evaluation/config.rb
inferno_core-0.6.0 lib/inferno/dsl/fhir_evaluation/config.rb
inferno_core-0.5.4 lib/inferno/dsl/fhir_evaluation/config.rb
inferno_core-0.5.3 lib/inferno/dsl/fhir_evaluation/config.rb