Class: Hotspots::OptionBasedExit::Safe

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Safe

Returns a new instance of Safe.



20
21
22
23
# File 'lib/hotspots/option_based_exit.rb', line 20

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



18
19
20
# File 'lib/hotspots/option_based_exit.rb', line 18

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



18
19
20
# File 'lib/hotspots/option_based_exit.rb', line 18

def message
  @message
end

Instance Method Details

#performObject



25
26
27
28
# File 'lib/hotspots/option_based_exit.rb', line 25

def perform
  puts @message
  exit @code
end