Class: Renogen::ExtractionStratagies::YamlFile::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/renogen/extraction_stratagies/yaml_file/parser.rb

Overview

Reads change data from files in configured directory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Parser

Returns a new instance of Parser.



9
10
11
12
# File 'lib/renogen/extraction_stratagies/yaml_file/parser.rb', line 9

def initialize(options={})
  @changelog = options[:changelog] || ChangeLog::Model.new
  @yaml_file_reader = Reader.new(options['changelog_path'], options)
end

Instance Attribute Details

#changelogObject (readonly)

Returns the value of attribute changelog.



7
8
9
# File 'lib/renogen/extraction_stratagies/yaml_file/parser.rb', line 7

def changelog
  @changelog
end

Instance Method Details

#parse!ChangeLog::Model

Returns:



15
16
17
18
19
20
# File 'lib/renogen/extraction_stratagies/yaml_file/parser.rb', line 15

def parse!
  yaml_file_reader.each_yaml_file do |file, index|
    parse_file(index, file)
  end
  changelog
end