class RefParsers::ParsingLogSummary

Attributes

number_of_entries[R]
number_of_ignored_entries[R]
number_of_imported_entries_without_type[R]
number_of_keys[R]
number_of_terminators[R]

Public Class Methods

new(parser_friendly_name) click to toggle source
# File lib/ref_parsers/line_parser.rb, line 11
def initialize(parser_friendly_name)
  @number_of_entries = 0
  @number_of_keys = 0
  @number_of_terminators = 0
  @number_of_ignored_entries = 0
  @number_of_imported_entries_without_type = 0
  @parser_friendly_name = parser_friendly_name
end

Public Instance Methods

detail_found(detail) click to toggle source
# File lib/ref_parsers/line_parser.rb, line 24
def detail_found(detail)
  @number_of_keys += 1 if detail.is_type_found
  @number_of_terminators += 1 if detail.is_terminator_found
  @number_of_ignored_entries += 1 if detail.action == :ignore_entry
  @number_of_imported_entries_without_type += 1 if detail.action == :import_entry
end
report_entries(entries) click to toggle source
# File lib/ref_parsers/line_parser.rb, line 20
def report_entries(entries)
  @number_of_entries = entries.length
end
to_s() click to toggle source
# File lib/ref_parsers/line_parser.rb, line 31
def to_s
  "Parser: #{@parser_friendly_name} Number of returned entries: #{@number_of_entries} | Number of keys: #{@number_of_keys} | Number of terminators: #{@number_of_terminators} | Ignored entries: #{@number_of_ignored_entries} | Entries without type key but still imported: #{@number_of_imported_entries_without_type}"
end