Exception: Rootage::NormalizerValueError
- Inherits:
-
StandardError
- Object
- StandardError
- Rootage::NormalizerValueError
- Defined in:
- lib/rootage/exception.rb
Overview
NormalizerValueError
is raised when the value cannot convert into the
normalization type.
Instance Method Summary collapse
-
#initialize(type, value, detail) ⇒ NormalizerValueError
constructor
A new instance of NormalizerValueError.
- #message ⇒ Object
Constructor Details
#initialize(type, value, detail) ⇒ NormalizerValueError
Returns a new instance of NormalizerValueError.
71 72 73 74 75 |
# File 'lib/rootage/exception.rb', line 71 def initialize(type, value, detail) @type = type @value = value @detail = detail end |
Instance Method Details
#message ⇒ Object
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/rootage/exception.rb', line 77 def 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 |