Class: UnicodePlot::Renderer
- Inherits:
-
Object
- Object
- UnicodePlot::Renderer
- Includes:
- BorderPrinter
- Defined in:
- lib/unicode_plot/renderer.rb
Constant Summary
Constants included from StyledPrinter
StyledPrinter::COLOR_DECODE, StyledPrinter::COLOR_ENCODE, StyledPrinter::DISABLE_TEXT_STYLE, StyledPrinter::TEXT_COLORS
Instance Attribute Summary collapse
-
#out ⇒ Object
readonly
Returns the value of attribute out.
-
#plot ⇒ Object
readonly
Returns the value of attribute plot.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(plot) ⇒ Renderer
constructor
A new instance of Renderer.
- #render(out) ⇒ Object
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.
54 55 56 57 |
# File 'lib/unicode_plot/renderer.rb', line 54 def initialize(plot) @plot = plot @out = nil end |
Instance Attribute Details
#out ⇒ Object (readonly)
Returns the value of attribute out.
60 61 62 |
# File 'lib/unicode_plot/renderer.rb', line 60 def out @out end |
#plot ⇒ Object (readonly)
Returns the value of attribute plot.
59 60 61 |
# File 'lib/unicode_plot/renderer.rb', line 59 def plot @plot end |
Class Method Details
.render(out, plot) ⇒ Object
50 51 52 |
# File 'lib/unicode_plot/renderer.rb', line 50 def self.render(out, plot) new(plot).render(out) end |
Instance Method Details
#render(out) ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/unicode_plot/renderer.rb', line 62 def render(out) @out = out init_render render_top render_rows render_bottom end |