Exception: Horologium::UnknownRepresentationError
- Defined in:
- lib/horologium/error.rb,
sig/horologium.rbs
Overview
Raised when a representation the library does not have is asked for. It carries the known representations so the caller can see the valid choices.
Instance Attribute Summary collapse
-
#known_representations ⇒ Array<Symbol>
readonly
The representations the library has.
Instance Method Summary collapse
-
#initialize(representation, known_representations) ⇒ UnknownRepresentationError
constructor
A new instance of UnknownRepresentationError.
Constructor Details
#initialize(representation, known_representations) ⇒ UnknownRepresentationError
Returns a new instance of UnknownRepresentationError.
92 93 94 95 96 97 98 |
# File 'lib/horologium/error.rb', line 92 def initialize(representation, known_representations) @known_representations = known_representations.dup.freeze super( "unknown representation #{representation.inspect}, " \ "expected one of #{known_representations.map(&:inspect).join(", ")}" ) end |
Instance Attribute Details
#known_representations ⇒ Array<Symbol> (readonly)
The representations the library has.
88 89 90 |
# File 'lib/horologium/error.rb', line 88 def known_representations @known_representations end |