Method: UnicodePlot::Canvas.create

Defined in:
lib/unicode_plot/canvas.rb

.create(canvas_type, width, height, **kw) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/unicode_plot/canvas.rb', line 5

def self.create(canvas_type, width, height, **kw)
  case canvas_type
  when :ascii
    AsciiCanvas.new(width, height, **kw)
  when :braille
    BrailleCanvas.new(width, height, **kw)
  when :density
    DensityCanvas.new(width, height, **kw)
  when :dot
    DotCanvas.new(width, height, **kw)
  else
    raise ArgumentError, "unknown canvas type: #{canvas_type}"
  end
end