Class: Inferno::DSL::FHIREvaluation::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/dsl/fhir_evaluation/config.rb

Constant Summary collapse

DEFAULT_FILE =
File.join(__dir__, 'default.yml')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file = nil) ⇒ Config

To-do: add config_file as arguments

Raises:

  • (TypeError)


9
10
11
12
13
14
15
16
17
# File 'lib/inferno/dsl/fhir_evaluation/config.rb', line 9

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

Instance Attribute Details

#dataObject

Returns the value of attribute data.



6
7
8
# File 'lib/inferno/dsl/fhir_evaluation/config.rb', line 6

def data
  @data
end