Class: Helene::SleepCycle
Constant Summary collapse
- Min =
0.01
- Max =
1.28
Instance Attribute Summary collapse
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
-
#pos ⇒ Object
Returns the value of attribute pos.
Instance Method Summary collapse
-
#initialize(*args) ⇒ SleepCycle
constructor
A new instance of SleepCycle.
- #next ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(*args) ⇒ SleepCycle
Returns a new instance of SleepCycle.
10 11 12 13 14 15 16 17 |
# File 'lib/helene/sleepcycle.rb', line 10 def initialize(*args) = args.. @min = [:min] || Min @max = [:max] || Max m = @min while m < @max; push(m) and m *= 2; end @pos = 0 end |
Instance Attribute Details
#max ⇒ Object
Returns the value of attribute max.
7 8 9 |
# File 'lib/helene/sleepcycle.rb', line 7 def max @max end |
#min ⇒ Object
Returns the value of attribute min.
6 7 8 |
# File 'lib/helene/sleepcycle.rb', line 6 def min @min end |
#pos ⇒ Object
Returns the value of attribute pos.
8 9 10 |
# File 'lib/helene/sleepcycle.rb', line 8 def pos @pos end |