Exception: NRSER::CountError
- Inherits:
-
AttrError
- Object
- StandardError
- ValueError
- AttrError
- NRSER::CountError
- Defined in:
- lib/nrser/errors/count_error.rb
Overview
Raised when we expected ‘#count` to be something it’s not.
Constant Summary
Constants included from NicerError
NicerError::DEFAULT_COLUMN_WIDTH
Instance Method Summary collapse
-
#count ⇒ Object
Alias for AttrError#actual.
-
#count? ⇒ Boolean
Alias for AttrError#actual?.
-
#initialize(*message, **kwds) ⇒ CountError
constructor
Create a new CountError.
Methods inherited from AttrError
#actual, #actual?, #default_message, #expected, #expected?, #name, #name?
Methods inherited from ValueError
Methods included from NicerError
#add_extended_message?, column_width, #context, #context_section, #default_message, #details, #details_section, #extended_message, #format_message, #format_message_segment, included, #to_s
Constructor Details
#initialize(*message, **kwds) ⇒ CountError
Create a new NRSER::CountError.
51 52 53 54 |
# File 'lib/nrser/errors/count_error.rb', line 51 def initialize *, **kwds kwds[:actual] = kwds.delete( :count ) if kwds.key?( :count ) super *, **kwds, name: :count end |
Instance Method Details
#count ⇒ Object
Alias for AttrError#actual.
60 |
# File 'lib/nrser/errors/count_error.rb', line 60 def count; actual; end |
#count? ⇒ Boolean
Alias for AttrError#actual?.
57 |
# File 'lib/nrser/errors/count_error.rb', line 57 def count?; actual?; end |