Exception: ComicInfo::Errors::RangeError
- Inherits:
-
ComicInfoError
- Object
- StandardError
- ComicInfoError
- ComicInfo::Errors::RangeError
- Defined in:
- lib/comicinfo/errors.rb
Overview
Error raised when numeric values are out of range
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(field, value, min, max) ⇒ RangeError
constructor
A new instance of RangeError.
Constructor Details
#initialize(field, value, min, max) ⇒ RangeError
Returns a new instance of RangeError.
36 37 38 39 40 41 42 |
# File 'lib/comicinfo/errors.rb', line 36 def initialize field, value, min, max @field = field @value = value @min = min @max = max super("Value '#{value}' for field '#{field}' is out of range (#{min}..#{max})") end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
34 35 36 |
# File 'lib/comicinfo/errors.rb', line 34 def field @field end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
34 35 36 |
# File 'lib/comicinfo/errors.rb', line 34 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
34 35 36 |
# File 'lib/comicinfo/errors.rb', line 34 def min @min end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
34 35 36 |
# File 'lib/comicinfo/errors.rb', line 34 def value @value end |