Class: Vedeu::Renderers::EscapeSequence
- Inherits:
-
Object
- Object
- Vedeu::Renderers::EscapeSequence
- Includes:
- Options
- Defined in:
- lib/vedeu/output/renderers/escape_sequence.rb
Overview
A renderer which returns the escape sequence for each character.
Instance Attribute Summary collapse
-
#options ⇒ Hash<Symbol => void>
included
from Options
private
Combines the options provided at instantiation with the default values.
Instance Method Summary collapse
-
#clear ⇒ String
Render a cleared output.
- #compress? ⇒ Boolean included from Options
-
#defaults ⇒ Hash<Symbol => void>
included
from Options
private
The default values for a new instance of this class.
-
#initialize(options = {}) ⇒ Vedeu::Renderers::EscapeSequence
constructor
Returns a new instance of Vedeu::Renderers::EscapeSequence.
-
#render(output) ⇒ String
Render the output with the escape sequences escaped.
Constructor Details
#initialize(options = {}) ⇒ Vedeu::Renderers::EscapeSequence
Returns a new instance of Vedeu::Renderers::EscapeSequence.
15 16 17 |
# File 'lib/vedeu/output/renderers/escape_sequence.rb', line 15 def initialize( = {}) = || {} end |
Instance Attribute Details
#options ⇒ Hash<Symbol => void> (private) Originally defined in module Options
Combines the options provided at instantiation with the default values.
Instance Method Details
#clear ⇒ String
Render a cleared output.
22 23 24 |
# File 'lib/vedeu/output/renderers/escape_sequence.rb', line 22 def clear '' end |
#compress? ⇒ Boolean Originally defined in module Options
#defaults ⇒ Hash<Symbol => void> (private) Originally defined in module Options
The default values for a new instance of this class.
#render(output) ⇒ String
Render the output with the escape sequences escaped.
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vedeu/output/renderers/escape_sequence.rb', line 30 def render(output) out = '' output.each do |row| row.each do |cell| out << Vedeu::EscapeSequences::Esc.escape(cell.to_s) end end out end |