Class: Tdc::DataDefinitionFileReader

Inherits:
DataDefinition show all
Defined in:
lib/tdc/data_definition_file_reader.rb

Overview

Knows how to read data definitions from YAML files.

Constant Summary collapse

EMPTY_DEFINITIONS =
[]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataDefinition

#with_indifferent_access

Constructor Details

#initialize(catalog_root_directory) ⇒ DataDefinitionFileReader

Returns a new instance of DataDefinitionFileReader.



10
11
12
# File 'lib/tdc/data_definition_file_reader.rb', line 10

def initialize(catalog_root_directory)
  @catalog_root_directory = catalog_root_directory
end

Instance Attribute Details

#catalog_root_directoryObject (readonly)

Returns the value of attribute catalog_root_directory.



8
9
10
# File 'lib/tdc/data_definition_file_reader.rb', line 8

def catalog_root_directory
  @catalog_root_directory
end

Instance Method Details

#read(*path_elements) ⇒ Object



14
15
16
17
18
# File 'lib/tdc/data_definition_file_reader.rb', line 14

def read(*path_elements)
  reader = Tdc::YamlReaders::YamlReaderFactory.new(@catalog_root_directory, path_elements).create

  reader.data_definitions
end