Exception: Horologium::UnknownOutputError
- Defined in:
- lib/horologium/error.rb,
sig/horologium.rbs
Overview
Raised when a representation is asked to come out in a type it does not have. It carries the types it does have so the caller can see the valid choices.
Instance Attribute Summary collapse
-
#known_outputs ⇒ Array<Symbol>
readonly
The types the representation can come out as.
Instance Method Summary collapse
-
#initialize(output, known_outputs) ⇒ UnknownOutputError
constructor
A new instance of UnknownOutputError.
Constructor Details
#initialize(output, known_outputs) ⇒ UnknownOutputError
Returns a new instance of UnknownOutputError.
112 113 114 115 116 117 118 |
# File 'lib/horologium/error.rb', line 112 def initialize(output, known_outputs) @known_outputs = known_outputs.dup.freeze super( "unknown output #{output.inspect}, " \ "expected one of #{known_outputs.map(&:inspect).join(", ")}" ) end |
Instance Attribute Details
#known_outputs ⇒ Array<Symbol> (readonly)
The types the representation can come out as.
108 109 110 |
# File 'lib/horologium/error.rb', line 108 def known_outputs @known_outputs end |