Class: PoweroffIn

Inherits:
Object
  • Object
show all
Defined in:
lib/poweroff_in.rb,
lib/poweroff_in/version.rb

Constant Summary collapse

MINUTE =
60
HOUR =
3600
VERSION =
"0.0.1"

Instance Method Summary collapse

Constructor Details

#initialize(arguments) ⇒ PoweroffIn

Returns a new instance of PoweroffIn.



8
9
10
11
12
13
# File 'lib/poweroff_in.rb', line 8

def initialize arguments
  validate arguments
  @amount = arguments[0].to_i
  @time = translate_word_to_time arguments[1]
  @progressbar = ProgressBar.create(:format => '%a %B %p%% %t')
end

Instance Method Details

#runObject



15
16
17
18
19
# File 'lib/poweroff_in.rb', line 15

def run
  user_is_sudo?
  show_message
  poweroff_after_delay
end