Class: Vedeu::Cells::Escape Private
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.
Provides the character/escape sequence to draw one cell of a with a custom value, colour and style.
The Vedeu::Cells::Escape object represents an escape sequence as a single character, meaning they will behave dependent on the context in which they are used.
(In a terminal, an escape sequence makes sense, when a view is being rendered as HTML, the sequence may be meaningless, for example; the sequence to show or hide the cursor.)
Instance Attribute Summary
Attributes inherited from Empty
Instance Method Summary collapse
- #null ⇒ NilClass (also: #background, #colour, #foreground, #style) private
- #text ⇒ String private
-
#to_h ⇒ Hash<void>
(also: #to_hash)
private
Return an empty hash as most escape sequences won’t make sense as JSON.
-
#to_html(_options = {}) ⇒ String
private
Return an empty string as most escape sequences won’t make sense as HTML.
- #to_s ⇒ String (also: #to_str) private
- #type ⇒ Symbol private
Methods inherited from Empty
#as_html, #border, #defaults, #eql?, #geometry, #interface, #to_ast, #value?
Methods included from Repositories::Defaults
#defaults, #initialize, #validate
Methods included from Vedeu::Common
#absent?, #array?, #boolean, #boolean?, #empty_value?, #escape?, #falsy?, #hash?, #line_model?, #numeric?, #positionable?, #present?, #snake_case, #stream_model?, #string?, #symbol?, #truthy?, #view_model?
Methods included from Presentation::Styles
#render_style, #style=, #style?
Methods included from Presentation::Parent
Methods included from Presentation::Position
#position, #position=, #position?, #render_position, #x, #y
Methods included from Presentation::Colour
#background=, #colour=, #colour?, #foreground=, #interface, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour
Instance Method Details
#null ⇒ NilClass Also known as: background, colour, foreground, style
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.
23 24 25 |
# File 'lib/vedeu/cells/escape.rb', line 23 def null nil end |
#text ⇒ String
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.
32 33 34 |
# File 'lib/vedeu/cells/escape.rb', line 32 def text '' end |
#to_h ⇒ Hash<void> Also known as: to_hash
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.
Return an empty hash as most escape sequences won’t make sense as JSON.
40 41 42 43 44 45 |
# File 'lib/vedeu/cells/escape.rb', line 40 def to_h { type: type, value: value, } end |
#to_html(_options = {}) ⇒ String
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.
Return an empty string as most escape sequences won’t make sense as HTML.
53 54 55 |
# File 'lib/vedeu/cells/escape.rb', line 53 def to_html( = {}) '' end |
#to_s ⇒ String Also known as: to_str
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.
58 59 60 |
# File 'lib/vedeu/cells/escape.rb', line 58 def to_s value end |
#type ⇒ Symbol
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.
64 65 66 |
# File 'lib/vedeu/cells/escape.rb', line 64 def type :escape end |