class Samovar::InvalidInputError
Raised when invalid input is provided on the command line.
Attributes
The command that encountered the error.
@attribute [Command]
Public Class Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/samovar-2.4.1/lib/samovar/error.rb, line 17 def initialize(command, input) @command = command @input = input super "Could not parse token #{input.first.inspect}" end
Initialize a new invalid input error.
@parameter command [Command] The command that encountered the error. @parameter input [Array(String)] The remaining input that could not be parsed.
Calls superclass method
Public Instance Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/samovar-2.4.1/lib/samovar/error.rb, line 34 def help? self.token == "--help" end
Check if the error was caused by a help request.
@returns [Boolean] True if the token is ‘–help`.
Source
# File vendor/bundle/ruby/3.4.0/gems/samovar-2.4.1/lib/samovar/error.rb, line 27 def token @input.first end
The token that could not be parsed.
@returns [String] The first unparsed token.