Class: Hotspots::OptionBasedExit::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/hotspots/option_based_exit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Error

Returns a new instance of Error.



6
7
8
9
# File 'lib/hotspots/option_based_exit.rb', line 6

def initialize(options)
  @message = options[:message]
  @code    = options[:code]
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/hotspots/option_based_exit.rb', line 4

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/hotspots/option_based_exit.rb', line 4

def message
  @message
end

Instance Method Details

#performObject



11
12
13
14
# File 'lib/hotspots/option_based_exit.rb', line 11

def perform
  puts @message
  exit @code
end