Class: Vedeu::Renderer

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/output/renderer.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*output) ⇒ Vedeu::Renderer

Parameters:



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

def initialize(*output)
  @output = output
end

Instance Attribute Details

#outputObject (readonly, private)

Returns the value of attribute output.



27
28
29
# File 'lib/vedeu/output/renderer.rb', line 27

def output
  @output
end

Class Method Details

.render(*output) ⇒ String

Parameters:

Returns:

  • (String)


10
11
12
# File 'lib/vedeu/output/renderer.rb', line 10

def self.render(*output)
  new(*output).render
end

Instance Method Details

#renderString

Returns:

  • (String)


21
22
23
# File 'lib/vedeu/output/renderer.rb', line 21

def render
  Array(output).flatten.map(&:to_s).join
end