Class: Charming::UI::Border
- Inherits:
-
Object
- Object
- Charming::UI::Border
- Defined in:
- lib/charming/ui/border.rb
Constant Summary collapse
- STYLES =
{ normal: Border.new( corners: ["+", "+", "+", "+"], edges: ["-", "|"] ), rounded: Border.new( corners: ["╭", "╮", "╰", "╯"], edges: ["─", "│"] ), thick: Border.new( corners: ["┏", "┓", "┗", "┛"], edges: ["━", "┃"] ), double: Border.new( corners: ["╔", "╗", "╚", "╝"], edges: ["═", "║"] ) }.freeze
Instance Attribute Summary collapse
-
#bottom_left ⇒ Object
readonly
Returns the value of attribute bottom_left.
-
#bottom_right ⇒ Object
readonly
Returns the value of attribute bottom_right.
-
#horizontal ⇒ Object
readonly
Returns the value of attribute horizontal.
-
#top_left ⇒ Object
readonly
Returns the value of attribute top_left.
-
#top_right ⇒ Object
readonly
Returns the value of attribute top_right.
-
#vertical ⇒ Object
readonly
Returns the value of attribute vertical.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(corners:, edges:) ⇒ Border
constructor
A new instance of Border.
Constructor Details
#initialize(corners:, edges:) ⇒ Border
Returns a new instance of Border.
8 9 10 11 |
# File 'lib/charming/ui/border.rb', line 8 def initialize(corners:, edges:) @top_left, @top_right, @bottom_left, @bottom_right = corners @horizontal, @vertical = edges end |
Instance Attribute Details
#bottom_left ⇒ Object (readonly)
Returns the value of attribute bottom_left.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def bottom_left @bottom_left end |
#bottom_right ⇒ Object (readonly)
Returns the value of attribute bottom_right.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def bottom_right @bottom_right end |
#horizontal ⇒ Object (readonly)
Returns the value of attribute horizontal.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def horizontal @horizontal end |
#top_left ⇒ Object (readonly)
Returns the value of attribute top_left.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def top_left @top_left end |
#top_right ⇒ Object (readonly)
Returns the value of attribute top_right.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def top_right @top_right end |
#vertical ⇒ Object (readonly)
Returns the value of attribute vertical.
6 7 8 |
# File 'lib/charming/ui/border.rb', line 6 def vertical @vertical end |
Class Method Details
.fetch(name) ⇒ Object
13 14 15 |
# File 'lib/charming/ui/border.rb', line 13 def self.fetch(name) STYLES.fetch(name.to_sym) end |