Class: Vedeu::Cells::Empty Private
- Inherits:
-
Object
- Object
- Vedeu::Cells::Empty
- Includes:
- Presentation, Repositories::Defaults
- Defined in:
- lib/vedeu/cells/empty.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.
Provides the character/escape sequence to draw one cell of a with a custom value, colour and style.
The Vedeu::Cells::Empty object represents an empty cell with no content and is the basis of all the Vedeu::Cells objects.
Instance Attribute Summary collapse
-
#name ⇒ String|Symbol
readonly
private
The name of the interface/view this cell belongs to.
- #value ⇒ String readonly private
Instance Method Summary collapse
-
#as_html ⇒ String
private
Returns the value represented as HTML.
- #border ⇒ Vedeu::Borders::Border private private
-
#defaults ⇒ Hash<Symbol => void>
private
private
The default options/attributes for a new instance of this class.
-
#eql?(other) ⇒ Boolean
(also: #==)
private
An object is equal when its values are the same.
- #geometry ⇒ Vedeu::Geometries::Geometry private private
- #interface ⇒ Vedeu::Interfaces::Interface private private
- #text ⇒ String private
- #to_ast ⇒ String private
- #to_h ⇒ Hash<Symbol => Hash<Symbol => String>, String> (also: #to_hash) private
-
#to_html(options = {}) ⇒ String
private
Returns the object represented as HTML.
- #type ⇒ Symbol private
Methods included from Repositories::Defaults
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
Methods included from Presentation::Styles
#parent, #render_style, #style, #style=
Methods included from Presentation::Position
#position, #position=, #position?, #render_position, #x, #y
Methods included from Presentation::Colour
#background, #background=, #colour, #colour=, #colour?, #foreground, #foreground=, #named_colour, #named_colour?, #parent, #parent_colour, #parent_colour?, #render_colour
Instance Attribute Details
#name ⇒ String|Symbol (readonly)
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 name of the interface/view this cell belongs to.
23 24 25 |
# File 'lib/vedeu/cells/empty.rb', line 23 def name @name end |
#value ⇒ String (readonly)
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.
27 28 29 |
# File 'lib/vedeu/cells/empty.rb', line 27 def value @value end |
Instance Method Details
#as_html ⇒ 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.
Returns the value represented as HTML.
32 33 34 |
# File 'lib/vedeu/cells/empty.rb', line 32 def as_html ' ' end |
#border ⇒ Vedeu::Borders::Border (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.
103 104 105 |
# File 'lib/vedeu/cells/empty.rb', line 103 def border Vedeu.borders.by_name(name) end |
#defaults ⇒ Hash<Symbol => void> (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.
The default options/attributes for a new instance of this class.
92 93 94 95 96 97 98 99 100 |
# File 'lib/vedeu/cells/empty.rb', line 92 def defaults { colour: {}, name: '', position: nil, style: '', value: '', } end |
#eql?(other) ⇒ Boolean Also known as: ==
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.
An object is equal when its values are the same.
40 41 42 |
# File 'lib/vedeu/cells/empty.rb', line 40 def eql?(other) self.class.equal?(other.class) && position == other.position end |
#geometry ⇒ Vedeu::Geometries::Geometry (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.
108 109 110 |
# File 'lib/vedeu/cells/empty.rb', line 108 def geometry Vedeu.geometries.by_name(name) end |
#interface ⇒ Vedeu::Interfaces::Interface (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.
113 114 115 |
# File 'lib/vedeu/cells/empty.rb', line 113 def interface Vedeu.interfaces.by_name(name) 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.
46 47 48 |
# File 'lib/vedeu/cells/empty.rb', line 46 def text ' ' end |
#to_ast ⇒ 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.
51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/vedeu/cells/empty.rb', line 51 def to_ast [ '[', [ position.to_ast, colour.to_ast, style.to_ast, ":#{type}", ].reject(&:empty?).join(' '), ']', ].join end |
#to_h ⇒ Hash<Symbol => Hash<Symbol => String>, String> 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.
65 66 67 68 69 70 71 72 |
# File 'lib/vedeu/cells/empty.rb', line 65 def to_h { name: name.to_s, style: style.to_s, type: type, value: value.to_s, }.merge!(colour.to_h).merge!(position.to_h) 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.
Returns the object represented as HTML.
80 81 82 |
# File 'lib/vedeu/cells/empty.rb', line 80 def to_html( = {}) Vedeu::Cells::HTML.new(self, ).to_html 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.
85 86 87 |
# File 'lib/vedeu/cells/empty.rb', line 85 def type :empty end |