Exception: Samovar::InvalidInputError
- Defined in:
- lib/samovar/error.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
- #help? ⇒ Boolean
-
#initialize(command, input) ⇒ InvalidInputError
constructor
A new instance of InvalidInputError.
- #token ⇒ Object
Constructor Details
#initialize(command, input) ⇒ InvalidInputError
Returns a new instance of InvalidInputError.
26 27 28 29 30 31 |
# File 'lib/samovar/error.rb', line 26 def initialize(command, input) @command = command @input = input super "Could not parse token #{input.first.inspect}" end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
41 42 43 |
# File 'lib/samovar/error.rb', line 41 def command @command end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
42 43 44 |
# File 'lib/samovar/error.rb', line 42 def input @input end |
Instance Method Details
#help? ⇒ Boolean
37 38 39 |
# File 'lib/samovar/error.rb', line 37 def help? self.token == "--help" end |
#token ⇒ Object
33 34 35 |
# File 'lib/samovar/error.rb', line 33 def token @input.first end |