class Valigator::CSV::RowValidators::Ragged

Attributes

options[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 9
def initialize(options = {})
  @options = options
end

Public Instance Methods

==(other) click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 35
def ==(other)
  self.class == other.class && options == other.options
end
error_message() click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 29
def error_message
  'Ragged or empty row'
end
error_type() click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 23
def error_type
  'ragged_row'
end
valid?(row) click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 15
def valid?(row)
  return true unless fields

  row.size >= fields.size
end

Private Instance Methods

fields() click to toggle source
# File lib/valigator/csv/row_validators/ragged.rb, line 43
def fields
  options[:fields]
end