Class: Valigator::CSV::FieldValidators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/valigator/csv/field_validators/base.rb

Direct Known Subclasses

Date, Integer, Mandatory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/valigator/csv/field_validators/base.rb', line 7

def initialize(options={})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/valigator/csv/field_validators/base.rb', line 5

def options
  @options
end

Instance Method Details

#==(other) ⇒ Object



31
32
33
# File 'lib/valigator/csv/field_validators/base.rb', line 31

def ==(other)
  self.class == other.class && options == other.options
end

#error_messageObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/valigator/csv/field_validators/base.rb', line 25

def error_message
  raise NotImplementedError
end

#error_typeObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/valigator/csv/field_validators/base.rb', line 19

def error_type
  raise NotImplementedError
end

#valid?(value) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/valigator/csv/field_validators/base.rb', line 13

def valid?(value)
  raise NotImplementedError
end