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
-
#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, #text, #to_ast
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
#name, #parent, #render_style, #style=
Methods included from Presentation::Position
#position, #position=, #position?, #render_position, #x, #y
Methods included from Presentation::Colour
#background=, #colour=, #colour?, #foreground=, #name, #named_colour, #named_colour?, #parent, #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 |
#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.
35 36 37 38 39 40 |
# File 'lib/vedeu/cells/escape.rb', line 35 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.
48 49 50 |
# File 'lib/vedeu/cells/escape.rb', line 48 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.
53 54 55 |
# File 'lib/vedeu/cells/escape.rb', line 53 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.
59 60 61 |
# File 'lib/vedeu/cells/escape.rb', line 59 def type :escape end |