Exception: Clingon::TypeMatchError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/clingon/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ TypeMatchError

Returns a new instance of TypeMatchError.



51
52
53
54
55
56
# File 'lib/clingon/errors.rb', line 51

def initialize(payload)
  @expected = payload[:expected]
  @received = payload[:received]
  msg = "Received #{received}, expected type #{expected}"
  super(msg)
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



50
51
52
# File 'lib/clingon/errors.rb', line 50

def expected
  @expected
end

#receivedObject (readonly)

Returns the value of attribute received.



50
51
52
# File 'lib/clingon/errors.rb', line 50

def received
  @received
end