Class: PoweroffIn
- Inherits:
-
Object
- Object
- PoweroffIn
- 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
-
#initialize(arguments) ⇒ PoweroffIn
constructor
A new instance of PoweroffIn.
- #run ⇒ Object
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
#run ⇒ Object
15 16 17 18 19 |
# File 'lib/poweroff_in.rb', line 15 def run user_is_sudo? poweroff_after_delay end |