Class: TomatoPaste::Vine
- Inherits:
-
Object
- Object
- TomatoPaste::Vine
- Defined in:
- lib/tomato_paste/vine.rb
Instance Attribute Summary collapse
-
#pomodori ⇒ Object
readonly
Returns the value of attribute pomodori.
Instance Method Summary collapse
- #add(pomodoro) ⇒ Object
- #big_break_time? ⇒ Boolean
- #current_pomodoro ⇒ Object
-
#initialize ⇒ Vine
constructor
A new instance of Vine.
Constructor Details
#initialize ⇒ Vine
Returns a new instance of Vine.
5 6 7 |
# File 'lib/tomato_paste/vine.rb', line 5 def initialize() @pomodori = [] end |
Instance Attribute Details
#pomodori ⇒ Object (readonly)
Returns the value of attribute pomodori.
3 4 5 |
# File 'lib/tomato_paste/vine.rb', line 3 def pomodori @pomodori end |
Instance Method Details
#add(pomodoro) ⇒ Object
9 10 11 |
# File 'lib/tomato_paste/vine.rb', line 9 def add(pomodoro) @pomodori << pomodoro end |
#big_break_time? ⇒ Boolean
17 18 19 20 |
# File 'lib/tomato_paste/vine.rb', line 17 def big_break_time? # a big break should happen every 4 pomodori !@pomodori.empty? && @pomodori.count % 4 == 0 end |
#current_pomodoro ⇒ Object
13 14 15 |
# File 'lib/tomato_paste/vine.rb', line 13 def current_pomodoro @pomodori.last end |