Class: Nyan::Buffer

Inherits:
Array
  • Object
show all
Defined in:
lib/nyan/buffer.rb

Instance Method Summary collapse

Constructor Details

#initialize(height, width, default) ⇒ Buffer

Returns a new instance of Buffer.



3
4
5
6
7
8
9
10
11
12
# File 'lib/nyan/buffer.rb', line 3

def initialize(height, width, default)
  @height  = height
  @width   = width
  @default = default
  super(height) do
    Array.new(width) do
      default
    end
  end
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/nyan/buffer.rb', line 14

def to_s
  join
end