Class: MiniHistogram::MiniUnicodePlot::Renderer

Inherits:
Object
  • Object
show all
Includes:
BorderPrinter
Defined in:
lib/mini_histogram/plot.rb

Constant Summary

Constants included from StyledPrinter

StyledPrinter::COLOR_DECODE, StyledPrinter::COLOR_ENCODE, StyledPrinter::DISABLE_TEXT_STYLE, StyledPrinter::TEXT_COLORS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BorderPrinter

#print_border_bottom, #print_border_top

Methods included from StyledPrinter

#color?, #print_color, #print_styled

Constructor Details

#initialize(plot) ⇒ Renderer

Returns a new instance of Renderer.



384
385
386
387
# File 'lib/mini_histogram/plot.rb', line 384

def initialize(plot)
  @plot = plot
  @out = nil
end

Instance Attribute Details

#outObject (readonly)

Returns the value of attribute out.



390
391
392
# File 'lib/mini_histogram/plot.rb', line 390

def out
  @out
end

#plotObject (readonly)

Returns the value of attribute plot.



389
390
391
# File 'lib/mini_histogram/plot.rb', line 389

def plot
  @plot
end

Class Method Details

.render(out, plot) ⇒ Object



380
381
382
# File 'lib/mini_histogram/plot.rb', line 380

def self.render(out, plot)
  new(plot).render(out)
end

Instance Method Details

#render(out) ⇒ Object



392
393
394
395
396
397
398
399
# File 'lib/mini_histogram/plot.rb', line 392

def render(out)
  @out = out
  init_render

  render_top
  render_rows
  render_bottom
end