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.
11 12 13 14 15 16 |
# File 'lib/samovar/error.rb', line 11 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.
26 27 28 |
# File 'lib/samovar/error.rb', line 26 def command @command end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
27 28 29 |
# File 'lib/samovar/error.rb', line 27 def input @input end |
Instance Method Details
#help? ⇒ Boolean
22 23 24 |
# File 'lib/samovar/error.rb', line 22 def help? self.token == "--help" end |
#token ⇒ Object
18 19 20 |
# File 'lib/samovar/error.rb', line 18 def token @input.first end |