Module: Symbiont::DataReader

Included in:
DataBuilder
Defined in:
lib/symbiont/data_reader.rb

Instance Method Summary collapse

Instance Method Details

#data_pathObject



7
8
9
10
11
# File 'lib/symbiont/data_reader.rb', line 7

def data_path
  return @data_path if @data_path
  return default_data_path if self.respond_to? :default_data_path
  nil
end

#data_path=(path) ⇒ Object



3
4
5
# File 'lib/symbiont/data_reader.rb', line 3

def data_path=(path)
  @data_path = path
end

#load(file) ⇒ Object

The data_source name here must match the name used for the class accessor in the data builder. It is this data_source variable that connects the reader and the builder.



16
17
18
# File 'lib/symbiont/data_reader.rb', line 16

def load(file)
  @data_source = YAML.load_file "#{data_path}/#{file}"
end