Exception: LedgerSync::Error::TypeError::StringFromSetError
- Inherits:
-
LedgerSync::Error
- Object
- StandardError
- LedgerSync::Error
- LedgerSync::Error::TypeError::StringFromSetError
- Defined in:
- lib/ledger_sync/error.rb
Instance Attribute Summary
Attributes inherited from LedgerSync::Error
Instance Method Summary collapse
-
#initialize(expected:, given:) ⇒ StringFromSetError
constructor
A new instance of StringFromSetError.
Constructor Details
#initialize(expected:, given:) ⇒ StringFromSetError
Returns a new instance of StringFromSetError.
48 49 50 51 52 53 54 |
# File 'lib/ledger_sync/error.rb', line 48 def initialize(expected:, given:) to_show = expected.first(10).join(', ') to_show += ", ... (#{expected.count - 10} more possible values)" if expected.count > 10 super( message: "Unexpected value. Given #{given}. Expected: #{to_show}" ) end |