Module: Reading::Parsing::Rows::CompactPlanned

Defined in:
lib/reading/parsing/rows/compact_planned.rb,
lib/reading/parsing/rows/compact_planned_columns/head.rb

Overview

A row that contains compact planned items.

Defined Under Namespace

Classes: Head

Class Method Summary collapse

Class Method Details

.column_classesArray<Class>

The columns that are possible in this type of row.

Returns:



15
16
17
# File 'lib/reading/parsing/rows/compact_planned.rb', line 15

def self.column_classes
  [CompactPlanned::Head, Regular::Sources, Regular::Length]
end

.match?(row_string) ⇒ Boolean

Starts with a comment character and includes one or more format emojis.

Parameters:

Returns:

  • (Boolean)


22
23
24
25
26
# File 'lib/reading/parsing/rows/compact_planned.rb', line 22

def self.match?(row_string)
  row_string.lstrip.start_with?(Config.hash.fetch(:comment_character)) &&
    row_string.match?(Config.hash.deep_fetch(:regex, :formats)) &&
    row_string.count(Config.hash.fetch(:column_separator)) <= column_classes.count - 1
end