class Rootage::NormalizerValueError

‘NormalizerValueError` is raised when the value cannot convert into the normalization type.

Public Class Methods

new(type, value, detail) click to toggle source
# File lib/rootage/exception.rb, line 71
def initialize(type, value, detail)
  @type = type
  @value = value
  @detail = detail
end

Public Instance Methods

message() click to toggle source
# File lib/rootage/exception.rb, line 77
def message
  case @type
  when Symbol
    '"%s" cannot normalize as "%s": %s' % [@value, @type, @detail]
  when Array
    '"%s" should be in the range of "%s".' % [@value, @type]
  else
    raise NormalizerTypeError.new(@type)
  end
end