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.



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

#commandObject (readonly)

Returns the value of attribute command.



41
42
43
# File 'lib/samovar/error.rb', line 41

def command
  @command
end

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

Returns:

  • (Boolean)


37
38
39
# File 'lib/samovar/error.rb', line 37

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

#tokenObject



33
34
35
# File 'lib/samovar/error.rb', line 33

def token
	@input.first
end