Class: Palaver::Pause
Instance Method Summary collapse
-
#initialize(options) ⇒ Pause
constructor
A new instance of Pause.
- #seconds(val) ⇒ Object
- #show ⇒ Object
Methods inherited from Base
#height, #text, #width, #with_tempfile
Constructor Details
#initialize(options) ⇒ Pause
Returns a new instance of Pause.
6 7 8 9 10 11 12 13 14 |
# File 'lib/palaver/pause.rb', line 6 def initialize() super() @seconds = 0 .each do |option,value| case option when :seconds then @seconds = value end end end |
Instance Method Details
#seconds(val) ⇒ Object
16 17 18 |
# File 'lib/palaver/pause.rb', line 16 def seconds(val) @seconds = val end |
#show ⇒ Object
20 21 22 23 24 |
# File 'lib/palaver/pause.rb', line 20 def show cmd = "dialog --pause '#@text' #@height #@width #@seconds" rc = system cmd return rc end |