Class: Vedeu::Renderers::EscapeSequence

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

Overview

A renderer which returns the escape sequence for each character.

Instance Method Summary collapse

Methods included from Vedeu::RendererOptions

#defaults, #options

Constructor Details

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

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

Parameters:

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


15
16
17
# File 'lib/vedeu/output/renderers/escape_sequence.rb', line 15

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

Instance Method Details

#render(output) ⇒ String

Render the output with the escape sequences escaped.

Parameters:

Returns:

  • (String)


23
24
25
26
27
28
29
30
31
# File 'lib/vedeu/output/renderers/escape_sequence.rb', line 23

def render(output)
  out = ''

  output.each do |row|
    row.each { |cell| out << Vedeu::Esc.escape(cell.to_s) }
  end

  out
end