Class: Intent::UI::Panel

Inherits:
Object
  • Object
show all
Defined in:
lib/intent/ui/ttyui.rb

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height) ⇒ Panel

Returns a new instance of Panel.



12
13
14
15
16
17
# File 'lib/intent/ui/ttyui.rb', line 12

def initialize(x, y, width, height)
  @x = x
  @y = y
  @width = width
  @height = height
end

Instance Method Details

#drawObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/intent/ui/ttyui.rb', line 19

def draw
  TTY::Box.frame(
    left: @x,
    top: @y,
    width: @width,
    height: @height,
    align: :center,
    border: :light,
    style: {
      fg: :white,
      border: {
        fg: :white,
      }
    }
  )
end