Exception: TypedArray::UnexpectedTypeException
- Inherits:
-
Exception
- Object
- Exception
- TypedArray::UnexpectedTypeException
- Defined in:
- lib/typed-array.rb
Overview
The exception that is raised when an Unexpected Type is reached during validation
Instance Attribute Summary collapse
-
#expected ⇒ Object
readonly
Provide access to the types of objects expected and the class of the object received.
-
#received ⇒ Object
readonly
Provide access to the types of objects expected and the class of the object received.
Instance Method Summary collapse
-
#initialize(expected_one_of, received) ⇒ UnexpectedTypeException
constructor
A new instance of UnexpectedTypeException.
- #to_s ⇒ Object
Constructor Details
#initialize(expected_one_of, received) ⇒ UnexpectedTypeException
Returns a new instance of UnexpectedTypeException.
46 47 48 49 |
# File 'lib/typed-array.rb', line 46 def initialize expected_one_of, received @expected = expected_one_of @received = received end |
Instance Attribute Details
#expected ⇒ Object (readonly)
Provide access to the types of objects expected and the class of the object received
44 45 46 |
# File 'lib/typed-array.rb', line 44 def expected @expected end |
#received ⇒ Object (readonly)
Provide access to the types of objects expected and the class of the object received
44 45 46 |
# File 'lib/typed-array.rb', line 44 def received @received end |
Instance Method Details
#to_s ⇒ Object
51 52 53 |
# File 'lib/typed-array.rb', line 51 def to_s %{Expected one of #{@expected.inspect} but received a(n) #{@received}} end |