Class: Bake::Blocks::Sleep
- Inherits:
-
Object
- Object
- Bake::Blocks::Sleep
- Defined in:
- lib/blocks/sleep.rb
Instance Method Summary collapse
- #clean ⇒ Object
- #cleanStep ⇒ Object
- #execute ⇒ Object
- #exitStep ⇒ Object
-
#initialize(config) ⇒ Sleep
constructor
A new instance of Sleep.
- #run ⇒ Object
- #startupStep ⇒ Object
Constructor Details
#initialize(config) ⇒ Sleep
Returns a new instance of Sleep.
6 7 8 9 |
# File 'lib/blocks/sleep.rb', line 6 def initialize(config) @echo = (config.echo != "off") @time = config.name.to_f end |
Instance Method Details
#clean ⇒ Object
33 34 35 36 |
# File 'lib/blocks/sleep.rb', line 33 def clean # nothing to do here return true end |
#cleanStep ⇒ Object
29 30 31 |
# File 'lib/blocks/sleep.rb', line 29 def cleanStep return run() end |
#execute ⇒ Object
17 18 19 |
# File 'lib/blocks/sleep.rb', line 17 def execute return run() end |
#exitStep ⇒ Object
25 26 27 |
# File 'lib/blocks/sleep.rb', line 25 def exitStep return run() end |
#run ⇒ Object
11 12 13 14 15 |
# File 'lib/blocks/sleep.rb', line 11 def run puts "Sleeping #{@time}s" if @echo sleep @time return true end |
#startupStep ⇒ Object
21 22 23 |
# File 'lib/blocks/sleep.rb', line 21 def startupStep return run() end |