Class: Text2048::TextView

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

Overview

Simple text view.

Defined Under Namespace

Classes: Row

Instance Method Summary collapse

Constructor Details

#initialize(output = STDOUT) ⇒ TextView

Returns a new instance of TextView.



18
19
20
# File 'lib/text2048/text_view.rb', line 18

def initialize(output = STDOUT)
  @output = output
end

Instance Method Details

#pop_tiles(_list) ⇒ Object



26
27
28
# File 'lib/text2048/text_view.rb', line 26

def pop_tiles(_list)
  # noop
end

#update(board) ⇒ Object



22
23
24
# File 'lib/text2048/text_view.rb', line 22

def update(board)
  @output.puts board.to_a.map { |row| Row.new(row).to_s }.join("\n")
end

#zoom_tiles(_list) ⇒ Object



30
31
32
# File 'lib/text2048/text_view.rb', line 30

def zoom_tiles(_list)
  # noop
end