Exception: LedgerSync::Error::UnexpectedClassError

Inherits:
LedgerSync::Error show all
Defined in:
lib/ledger_sync/error.rb

Direct Known Subclasses

TypeError::ValueClassError

Instance Attribute Summary

Attributes inherited from LedgerSync::Error

#message

Instance Method Summary collapse

Constructor Details

#initialize(expected:, given:) ⇒ UnexpectedClassError

Returns a new instance of UnexpectedClassError.



34
35
36
37
38
39
40
# File 'lib/ledger_sync/error.rb', line 34

def initialize(expected:, given:)
  expected = Array(expected)

  super(
    message: "Unexpected class.  Given #{given.name}.  Expected: #{expected.map(&:name).join(', ')}"
  )
end