Exception: Samovar::InvalidInputError

Inherits:
Error
  • Object
show all
Defined in:
lib/samovar/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



26
27
28
# File 'lib/samovar/error.rb', line 26

def command
  @command
end

#inputObject (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

Returns:

  • (Boolean)


22
23
24
# File 'lib/samovar/error.rb', line 22

def help?
	self.token == "--help"
end

#tokenObject



18
19
20
# File 'lib/samovar/error.rb', line 18

def token
	@input.first
end