Class: Vedeu::Cells::Border Private

Inherits:
Empty
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/vedeu/cells/border.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 border with a custom value, colour and style.

Direct Known Subclasses

Corner, Horizontal, Vertical

Instance Attribute Summary

Attributes inherited from Empty

#name

Instance Method Summary collapse

Methods inherited from Empty

#as_html, #border, #eql?, #geometry, #interface, #text, #to_ast, #to_h, #to_html, #value?

Methods included from Repositories::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=, #style?

Methods included from Presentation::Parent

#name, #parent, #parent?

Methods included from Presentation::Position

#position, #position=, #position?, #render_position, #x, #y

Methods included from Presentation::Colour

#background, #background=, #colour, #colour=, #colour?, #foreground, #foreground=, #interface, #named_colour, #named_colour?, #parent_colour, #parent_colour?, #render_colour

Methods included from Presentation

#to_s

Instance Method Details

#attributesHash<Symbol => void>

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:

  • (Hash<Symbol => void>)


23
24
25
26
27
28
29
# File 'lib/vedeu/cells/border.rb', line 23

def attributes
  {
    colour: colour,
    name:   @name,
    style:  style,
  }
end

#defaultsHash<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.

Returns:

  • (Hash<Symbol => void>)


54
55
56
# File 'lib/vedeu/cells/border.rb', line 54

def defaults
  super
end

#name=(value) ⇒ Vedeu::Cells::Border

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.

Parameters:

  • value (String|Symbol)

Returns:



33
34
35
36
37
# File 'lib/vedeu/cells/border.rb', line 33

def name=(value)
  @name = value

  self
end

#typeSymbol

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:

  • (Symbol)


40
41
42
# File 'lib/vedeu/cells/border.rb', line 40

def type
  :border
end

#valueString

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)


45
46
47
48
49
# File 'lib/vedeu/cells/border.rb', line 45

def value
  return '' unless present?(@value)

  Vedeu.esc.border { @value }
end