class Valigator::CSV::FieldValidators::Base

Attributes

options[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 31
def ==(other)
  self.class == other.class && options == other.options
end
error_message() click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 25
def error_message
  raise NotImplementedError
end
error_type() click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 19
def error_type
  raise NotImplementedError
end
valid?(value) click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 13
def valid?(value)
  raise NotImplementedError
end

Private Instance Methods

allow_blank() click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 45
def allow_blank
  options[:allow_blank]
end
blank?(value) click to toggle source
# File lib/valigator/csv/field_validators/base.rb, line 39
def blank?(value)
  value.to_s.empty?
end