Class: Zizia::Validator::Error

Inherits:
Struct
  • Object
show all
Defined in:
lib/zizia/validator.rb

Overview

A representation of an error encountered in validation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#description#to_s

Returns a long form description or message.

Returns:

  • (#to_s)

    a long form description or message



58
59
60
# File 'lib/zizia/validator.rb', line 58

def description
  @description
end

#lineno#to_s

Returns the line number, or other indication of the location where the error was encountered.

Returns:

  • (#to_s)

    the line number, or other indication of the location where the error was encountered



58
59
60
# File 'lib/zizia/validator.rb', line 58

def lineno
  @lineno
end

#name#to_s

Returns a short descriptive name for the given error.

Returns:

  • (#to_s)

    a short descriptive name for the given error



58
59
60
# File 'lib/zizia/validator.rb', line 58

def name
  @name
end

#validator#to_s

Returns the validator that generated this error.

Returns:

  • (#to_s)

    the validator that generated this error



58
59
60
# File 'lib/zizia/validator.rb', line 58

def validator
  @validator
end

Instance Method Details

#to_sString

Returns:

  • (String)


78
79
80
# File 'lib/zizia/validator.rb', line 78

def to_s
  "#{name}: #{description} (#{validator})"
end

#validator_error?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/zizia/validator.rb', line 72

def validator_error?
  true
end