Class: Plz::ErrorCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/plz/error_command.rb

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ ErrorCommand

Returns a new instance of ErrorCommand.

Parameters:

  • error (Plz::Error)

    Error to show error message to user



4
5
6
# File 'lib/plz/error_command.rb', line 4

def initialize(error)
  @error = error
end

Instance Method Details

#callObject

Logs out error reason and usage, then exits with error code 1



9
10
11
12
# File 'lib/plz/error_command.rb', line 9

def call
  puts "Error: #{@error}"
  exit(1)
end