Class: Reading::BlankRow
Overview
An empty or commented-out row. A null object which returns an empty array.
Class Method Summary collapse
-
.match?(line) ⇒ Boolean
Whether the given CSV line is a blank row.
Instance Method Summary collapse
-
#parse ⇒ Object
Overrides Row#parse.
Methods inherited from Row
Constructor Details
This class inherits a constructor from Reading::Row
Class Method Details
.match?(line) ⇒ Boolean
Whether the given CSV line is a blank row.
11 12 13 14 15 16 |
# File 'lib/reading/row/blank_row.rb', line 11 def self.match?(line) comment_char = line.csv.config.deep_fetch(:csv, :comment_character) line.string.strip.empty? || line.string.strip.start_with?(comment_char) end |
Instance Method Details
#parse ⇒ Object
Overrides Row#parse.
19 20 21 |
# File 'lib/reading/row/blank_row.rb', line 19 def parse [] end |