Class: Pompom::View

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(screen) ⇒ View

Returns a new instance of View.



145
146
147
148
# File 'lib/pompom.rb', line 145

def initialize(screen)
  @screen = screen
  @asciifier = Asciifier.new
end

Instance Attribute Details

#asciifier=(value) ⇒ Object (writeonly)

Sets the attribute asciifier

Parameters:

  • value

    the value to set the attribute asciifier to.



143
144
145
# File 'lib/pompom.rb', line 143

def asciifier=(value)
  @asciifier = value
end

Instance Method Details

#run(&block) ⇒ Object



150
151
152
# File 'lib/pompom.rb', line 150

def run(&block)
  @screen.run(&block)
end

#update(pomodoro) ⇒ Object



154
155
156
# File 'lib/pompom.rb', line 154

def update(pomodoro)
  @screen.display format_for_screen(pomodoro.time_remaining), color(pomodoro), blink(pomodoro)
end