Module: Fluent::DataReader
- Included in:
- DataBuilder, DataConfig
- Defined in:
- lib/fluent/data_reader.rb
Instance Method Summary collapse
- #data_path ⇒ Object
- #data_path=(path) ⇒ Object
-
#load(file) ⇒ Object
The data_source name here must match the name used for the class accessor in the data builder.
Instance Method Details
#data_path ⇒ Object
8 9 10 11 |
# File 'lib/fluent/data_reader.rb', line 8 def data_path return @data_path if @data_path return default_data_path if self.respond_to? :default_data_path end |
#data_path=(path) ⇒ Object
4 5 6 |
# File 'lib/fluent/data_reader.rb', line 4 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/fluent/data_reader.rb', line 16 def load(file) @data_source = YAML.load_file "#{data_path}/#{file}" end |