Class: Inferno::DSL::FHIREvaluation::Config
- Inherits:
-
Object
- Object
- Inferno::DSL::FHIREvaluation::Config
- Defined in:
- lib/inferno/dsl/fhir_evaluation/config.rb
Constant Summary collapse
- DEFAULT_FILE =
File.join(__dir__, 'default.yml')
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(config_file = nil) ⇒ Config
constructor
To-do: add config_file as arguments.
Constructor Details
#initialize(config_file = nil) ⇒ Config
To-do: add config_file as arguments
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
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/inferno/dsl/fhir_evaluation/config.rb', line 6 def data @data end |