Class: Reading::CompactPlannedRow

Inherits:
Row show all
Defined in:
lib/reading/row/compact_planned_row.rb

Overview

Parses a row of compactly listed planned items into an array of hashes of item data.

Class Method Summary collapse

Methods inherited from Row

#initialize, #parse

Constructor Details

This class inherits a constructor from Reading::Row

Class Method Details

.match?(line) ⇒ Boolean

Whether the given CSV line is a compact planned row.

Parameters:

Returns:

  • (Boolean)


15
16
17
18
19
20
# File 'lib/reading/row/compact_planned_row.rb', line 15

def self.match?(line)
  comment_char = line.csv.config.deep_fetch(:csv, :comment_character)

  line.string.strip.start_with?(comment_char) &&
    line.string.match?(line.csv.config.deep_fetch(:csv, :regex, :compact_planned_row_start))
end