Class: Timer
- Inherits:
-
Object
- Object
- Timer
- Defined in:
- lib/timer.rb
Instance Attribute Summary collapse
-
#alt_status ⇒ Object
readonly
Returns the value of attribute alt_status.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#time_to_change ⇒ Object
readonly
Returns the value of attribute time_to_change.
Instance Method Summary collapse
-
#initialize(morning_range, evening_range, current_time = Time.now) ⇒ Timer
constructor
Gives back a timer object.
Constructor Details
#initialize(morning_range, evening_range, current_time = Time.now) ⇒ Timer
Gives back a timer object
10 11 12 13 14 15 16 17 |
# File 'lib/timer.rb', line 10 def initialize(morning_range, evening_range, current_time= Time.now) @morning_range = morning_range @evening_range = evening_range @current_time = current_time @time_to_change = find_remaining_time @status = find_status @alt_status = alternate_status end |
Instance Attribute Details
#alt_status ⇒ Object (readonly)
Returns the value of attribute alt_status.
4 5 6 |
# File 'lib/timer.rb', line 4 def alt_status @alt_status end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/timer.rb', line 4 def status @status end |
#time_to_change ⇒ Object (readonly)
Returns the value of attribute time_to_change.
4 5 6 |
# File 'lib/timer.rb', line 4 def time_to_change @time_to_change end |