Exception: Linen::CLI::AbstractAmbiguityError
- Inherits:
-
NameError
- Object
- NameError
- Linen::CLI::AbstractAmbiguityError
- Defined in:
- lib/linen/exceptions.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#candidates ⇒ Object
Returns the value of attribute candidates.
-
#input ⇒ Object
Returns the value of attribute input.
Instance Method Summary collapse
-
#initialize(candidates = [], input = '') ⇒ AbstractAmbiguityError
constructor
A new instance of AbstractAmbiguityError.
- #to_s ⇒ Object
Constructor Details
#initialize(candidates = [], input = '') ⇒ AbstractAmbiguityError
Returns a new instance of AbstractAmbiguityError.
19 20 21 22 |
# File 'lib/linen/exceptions.rb', line 19 def initialize( candidates = [], input = '' ) @candidates = candidates @input = input end |
Instance Attribute Details
#candidates ⇒ Object
Returns the value of attribute candidates.
17 18 19 |
# File 'lib/linen/exceptions.rb', line 17 def candidates @candidates end |
#input ⇒ Object
Returns the value of attribute input.
17 18 19 |
# File 'lib/linen/exceptions.rb', line 17 def input @input end |
Instance Method Details
#to_s ⇒ Object
24 25 26 27 28 |
# File 'lib/linen/exceptions.rb', line 24 def to_s type = self.class.to_s.match( /Ambiguous(.*?)Error/ )[1].downcase return "The #{type} you entered ('#{@input}') was ambiguous; please select from the following: #{@candidates.join ', '}" end |