Class: TomatoPaste::Vine

Inherits:
Object
  • Object
show all
Defined in:
lib/tomato_paste/vine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeVine

Returns a new instance of Vine.



5
6
7
# File 'lib/tomato_paste/vine.rb', line 5

def initialize()
  @pomodori = []
end

Instance Attribute Details

#pomodoriObject (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

Returns:

  • (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_pomodoroObject



13
14
15
# File 'lib/tomato_paste/vine.rb', line 13

def current_pomodoro
  @pomodori.last
end