Class: Vedeu::Renderers::Terminal

Inherits:
Object
  • Object
show all
Includes:
Vedeu::RendererOptions
Defined in:
lib/vedeu/output/renderers/terminal.rb

Overview

Converts a grid of Views::Char objects into a stream of escape sequences and content suitable for a terminal.

Instance Method Summary collapse

Methods included from Vedeu::RendererOptions

#defaults, #options

Constructor Details

#initialize(options = {}) ⇒ Vedeu::Renderers::Terminal

Returns a new instance of Vedeu::Renderers::Terminal.

Parameters:

  • options (Hash) (defaults to: {})


16
17
18
# File 'lib/vedeu/output/renderers/terminal.rb', line 16

def initialize(options = {})
  @options = options || {}
end

Instance Method Details

#parse(output) ⇒ Array<Array<Vedeu::Views::Char>> (private)

Parameters:

Returns:



32
33
34
# File 'lib/vedeu/output/renderers/terminal.rb', line 32

def parse(output)
  Vedeu::Output::Compressor.render(output)
end

#render(output) ⇒ Array<String>

Parameters:

Returns:

  • (Array<String>)


22
23
24
25
26
# File 'lib/vedeu/output/renderers/terminal.rb', line 22

def render(output)
  output = parse(output)

  Vedeu::Terminal.output(output)
end