Class: Vedeu::Renderers::Terminal Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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

#options

Instance Method Summary collapse

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

#clearString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Render a cleared output.

Returns:

  • (String)


19
20
21
22
23
# File 'lib/vedeu/renderers/terminal.rb', line 19

def clear
  Vedeu::Terminal.clear

  render('')
end

#contentString (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the output in a compressed form if the :compression option is true.

Returns:

  • (String)


38
39
40
# File 'lib/vedeu/renderers/terminal.rb', line 38

def content
  compression
end

#writable_dataString (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


43
44
45
46
47
# File 'lib/vedeu/renderers/terminal.rb', line 43

def writable_data
  return write_file if write_file?

  content
end

#writeString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Render the output (either content or clearing) to the console.

Returns:

  • (String)


28
29
30
# File 'lib/vedeu/renderers/terminal.rb', line 28

def write
  Vedeu.direct_write(writable_data)
end