Class: Vedeu::Borders::Border Private
- Inherits:
-
Object
- Object
- Vedeu::Borders::Border
- Extended by:
- Forwardable
- Includes:
- Presentation, Presentation::Colour, Presentation::Position, Presentation::Styles, Repositories::Model
- Defined in:
- lib/vedeu/borders/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.
Refer to UTF-8 U+2500 to U+257F for border characters. More details can be found at: en.wikipedia.org/wiki/Box-drawing_character
Provides the mechanism to decorate an interface with a border on all edges, or specific edges. The characters which are used for the border parts (e.g. the corners, verticals and horizontals) can be customised as can the colours and styles.
More information can be found at: Borders
Instance Attribute Summary collapse
-
#bottom_horizontal ⇒ Vedeu::Cells::BottomHorizontal
private
Return the client application configured bottom horizontal cell character, or the default if not set.
-
#bottom_left ⇒ Vedeu::Cells::BottomLeft
private
Return the client application configured bottom left cell character, or the default if not set.
-
#bottom_right ⇒ Vedeu::Cells::BottomRight
private
Return the client application configured bottom right cell character, or the default if not set.
-
#caption ⇒ String
private
An optional caption for when the bottom border is to be shown.
-
#enabled ⇒ Boolean
(also: #enabled?)
Determines whether this border should be rendered.
-
#horizontal ⇒ String
The character to be used for the horizontal side border.
-
#left_vertical ⇒ Vedeu::Cells::LeftVertical
private
Return the client application configured left vertical cell character, or the default if not set.
-
#name ⇒ NilClass|Symbol|String
readonly
private
The name of the model, the target model or the name of the associated model.
-
#parent ⇒ Vedeu::Interfaces::Interface|NilClass
readonly
private
The interface/ view associated with this border.
-
#right_vertical ⇒ Vedeu::Cells::RightVertical
private
Return the client application configured right vertical cell character, or the default if not set.
-
#show_bottom ⇒ Boolean
(also: #bottom?)
Determines whether the bottom border should be shown.
-
#show_left ⇒ Boolean
(also: #left?)
Determines whether the left border should be shown.
-
#show_right ⇒ Boolean
(also: #right?)
Determines whether the right border should be shown.
-
#show_top ⇒ Boolean
(also: #top?)
Determines whether the top border should be shown.
-
#title ⇒ String
private
An optional title for when the top border is to be shown.
-
#top_horizontal ⇒ Vedeu::Cells::TopHorizontal
private
Return the client application configured top horizontal cell character, or the default if not set.
-
#top_left ⇒ Vedeu::Cells::TopLeft
private
Return the client application configured top left cell character, or the default if not set.
-
#top_right ⇒ Vedeu::Cells::TopRight
private
Return the client application configured top right cell character, or the default if not set.
-
#vertical ⇒ String
The character to be used for the vertical side border.
Attributes included from Repositories::Model
Instance Method Summary collapse
- #attributes ⇒ Hash<Symbol => Boolean|Hash|NilClass|String|Symbol| Vedeu::Borders::Repository|Vedeu::Presentation::Style> private
- #cell_attributes ⇒ Hash<Symbol => void> private private
-
#defaults ⇒ Hash<Symbol => void>
private
private
The default options/attributes for a new instance of this class.
-
#deputy(client = nil) ⇒ Vedeu::Borders::DSL
private
Returns a DSL instance responsible for defining the DSL methods of this model.
-
#initialize(attributes = {}) ⇒ Vedeu::Borders::Border
constructor
private
Returns a new instance of Vedeu::Borders::Border.
Methods included from Presentation::Styles
#render_style, #style, #style=, #style?
Methods included from Presentation::Parent
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?
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
Methods included from Repositories::Model
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Borders::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.
Returns a new instance of Vedeu::Borders::Border.
171 172 173 174 175 |
# File 'lib/vedeu/borders/border.rb', line 171 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#bottom_horizontal ⇒ Vedeu::Cells::BottomHorizontal
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 the client application configured bottom horizontal cell character, or the default if not set.
271 272 273 274 |
# File 'lib/vedeu/borders/border.rb', line 271 def bottom_horizontal @bottom_horizontal ||= Vedeu::Cells::BottomHorizontal .new(cell_attributes) end |
#bottom_left ⇒ Vedeu::Cells::BottomLeft
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 the client application configured bottom left cell character, or the default if not set.
280 281 282 |
# File 'lib/vedeu/borders/border.rb', line 280 def bottom_left @bottom_left ||= Vedeu::Cells::BottomLeft.new(cell_attributes) end |
#bottom_right ⇒ Vedeu::Cells::BottomRight
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 the client application configured bottom right cell character, or the default if not set.
288 289 290 |
# File 'lib/vedeu/borders/border.rb', line 288 def bottom_right @bottom_right ||= Vedeu::Cells::BottomRight.new(cell_attributes) end |
#caption ⇒ 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 An optional caption for when the bottom border is to be shown.
48 49 50 |
# File 'lib/vedeu/borders/border.rb', line 48 def @caption end |
#enabled ⇒ Boolean Also known as: enabled?
Returns Determines whether this border should be rendered.
126 127 128 |
# File 'lib/vedeu/borders/border.rb', line 126 def enabled @enabled end |
#horizontal ⇒ String
Returns The character to be used for the horizontal side border.
53 54 55 |
# File 'lib/vedeu/borders/border.rb', line 53 def horizontal @horizontal end |
#left_vertical ⇒ Vedeu::Cells::LeftVertical
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 the client application configured left vertical cell character, or the default if not set.
231 232 233 |
# File 'lib/vedeu/borders/border.rb', line 231 def left_vertical @left_vertical ||= Vedeu::Cells::LeftVertical.new(cell_attributes) end |
#name ⇒ NilClass|Symbol|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.
Returns The name of the model, the target model or the name of the associated model.
116 117 118 |
# File 'lib/vedeu/borders/border.rb', line 116 def name @name end |
#parent ⇒ Vedeu::Interfaces::Interface|NilClass (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 interface/ view associated with this border.
121 122 123 |
# File 'lib/vedeu/borders/border.rb', line 121 def parent @parent end |
#right_vertical ⇒ Vedeu::Cells::RightVertical
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 the client application configured right vertical cell character, or the default if not set.
239 240 241 |
# File 'lib/vedeu/borders/border.rb', line 239 def right_vertical @right_vertical ||= Vedeu::Cells::RightVertical.new(cell_attributes) end |
#show_bottom ⇒ Boolean Also known as: bottom?
Returns Determines whether the bottom border should be shown.
58 59 60 |
# File 'lib/vedeu/borders/border.rb', line 58 def show_bottom @show_bottom end |
#show_left ⇒ Boolean Also known as: left?
Returns Determines whether the left border should be shown.
64 65 66 |
# File 'lib/vedeu/borders/border.rb', line 64 def show_left @show_left end |
#show_right ⇒ Boolean Also known as: right?
Returns Determines whether the right border should be shown.
70 71 72 |
# File 'lib/vedeu/borders/border.rb', line 70 def show_right @show_right end |
#show_top ⇒ Boolean Also known as: top?
Returns Determines whether the top border should be shown.
76 77 78 |
# File 'lib/vedeu/borders/border.rb', line 76 def show_top @show_top end |
#title ⇒ 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 An optional title for when the top border is to be shown.
82 83 84 |
# File 'lib/vedeu/borders/border.rb', line 82 def title @title end |
#top_horizontal ⇒ Vedeu::Cells::TopHorizontal
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 the client application configured top horizontal cell character, or the default if not set.
247 248 249 |
# File 'lib/vedeu/borders/border.rb', line 247 def top_horizontal @top_horizontal ||= Vedeu::Cells::TopHorizontal.new(cell_attributes) end |
#top_left ⇒ Vedeu::Cells::TopLeft
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 the client application configured top left cell character, or the default if not set.
255 256 257 |
# File 'lib/vedeu/borders/border.rb', line 255 def top_left @top_left ||= Vedeu::Cells::TopLeft.new(cell_attributes) end |
#top_right ⇒ Vedeu::Cells::TopRight
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 the client application configured top right cell character, or the default if not set.
263 264 265 |
# File 'lib/vedeu/borders/border.rb', line 263 def top_right @top_right ||= Vedeu::Cells::TopRight.new(cell_attributes) end |
#vertical ⇒ String
Returns The character to be used for the vertical side border.
102 103 104 |
# File 'lib/vedeu/borders/border.rb', line 102 def vertical @vertical end |
Instance Method Details
#attributes ⇒ Hash<Symbol => Boolean|Hash|NilClass|String|Symbol| Vedeu::Borders::Repository|Vedeu::Presentation::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.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/vedeu/borders/border.rb', line 179 def attributes { bottom_horizontal: bottom_horizontal, bottom_left: bottom_left, bottom_right: bottom_right, caption: , client: @client, colour: colour, enabled: @enabled, horizontal: @horizontal, left_vertical: left_vertical, name: name, parent: @parent, repository: @repository, right_vertical: right_vertical, show_bottom: @show_bottom, show_left: @show_left, show_right: @show_right, show_top: @show_top, style: style, title: title, top_horizontal: top_horizontal, top_left: top_left, top_right: top_right, vertical: @vertical, } end |
#cell_attributes ⇒ 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.
303 304 305 306 307 308 309 |
# File 'lib/vedeu/borders/border.rb', line 303 def cell_attributes { colour: colour, name: name, style: style, } 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.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/vedeu/borders/border.rb', line 312 def defaults { bottom_horizontal: nil, bottom_left: nil, bottom_right: nil, caption: '', client: nil, colour: nil, enabled: false, horizontal: Vedeu.esc.horizontal, left_vertical: nil, name: nil, parent: nil, repository: Vedeu.borders, right_vertical: nil, show_bottom: true, show_left: true, show_right: true, show_top: true, style: nil, title: '', top_horizontal: nil, top_left: nil, top_right: nil, vertical: Vedeu.esc.vertical, } end |
#deputy(client = nil) ⇒ Vedeu::Borders::DSL
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 a DSL instance responsible for defining the DSL methods of this model.
223 224 225 |
# File 'lib/vedeu/borders/border.rb', line 223 def deputy(client = nil) Vedeu::Borders::DSL.new(self, client) end |