Class: Vedeu::Renderers::Terminal
- Inherits:
-
Object
- Object
- Vedeu::Renderers::Terminal
- Includes:
- Options
- Defined in:
- lib/vedeu/renderers/terminal.rb
Overview
Converts a grid of Cells::Char objects into a stream of escape sequences and content suitable for a terminal.
Instance Attribute Summary
Attributes included from Options
Instance Method Summary collapse
-
#clear ⇒ String
Render a cleared output.
-
#content ⇒ String
private
Returns the output in a compressed form if the :compression option is true.
- #writable_data ⇒ String private
-
#write ⇒ String
Render the output (either content or clearing) to the console.
Methods included from Options
#compression, #compression?, #default_template, #defaults, #end_row_tag, #end_tag, #filename, #initialize, #output, #output?, #render, #start_row_tag, #start_tag, #template, #timestamp, #timestamp?, #write_file, #write_file?
Methods included from Common
#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?
Instance Method Details
#clear ⇒ String
Render a cleared output.
17 18 19 20 21 |
# File 'lib/vedeu/renderers/terminal.rb', line 17 def clear Vedeu::Terminal.clear render('') end |
#content ⇒ String (private)
Returns the output in a compressed form if the :compression option is true.
36 37 38 |
# File 'lib/vedeu/renderers/terminal.rb', line 36 def content compression end |
#writable_data ⇒ String (private)
41 42 43 44 45 |
# File 'lib/vedeu/renderers/terminal.rb', line 41 def writable_data return write_file if write_file? content end |
#write ⇒ String
Render the output (either content or clearing) to the console.
26 27 28 |
# File 'lib/vedeu/renderers/terminal.rb', line 26 def write Vedeu.direct_write(writable_data) end |