Class: Fir::Screen

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output, error) ⇒ Screen

Returns a new instance of Screen.



14
15
16
17
18
# File 'lib/fir/screen.rb', line 14

def initialize(output, error)
  @eraser = Eraser.new(output)
  @renderer = Renderer.new(output)
  @evaluater = Evaluater.new(output, error)
end

Instance Attribute Details

#eraserObject (readonly)

Returns the value of attribute eraser.



10
11
12
# File 'lib/fir/screen.rb', line 10

def eraser
  @eraser
end

#evaluaterObject (readonly)

Returns the value of attribute evaluater.



12
13
14
# File 'lib/fir/screen.rb', line 12

def evaluater
  @evaluater
end

#rendererObject (readonly)

Returns the value of attribute renderer.



11
12
13
# File 'lib/fir/screen.rb', line 11

def renderer
  @renderer
end

Instance Method Details

#update(state, new_state) ⇒ Object



20
21
22
23
24
# File 'lib/fir/screen.rb', line 20

def update(state, new_state)
  eraser.perform(state)
  renderer.perform(new_state)
  evaluater.perform(new_state)
end