Class: RatatuiRuby::Widgets::Shape::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/ratatui_ruby/widgets/canvas.rb

Overview

A line shape on a canvas.

x1

The starting x-coordinate.

y1

The starting y-coordinate.

x2

The ending x-coordinate.

y2

The ending y-coordinate.

color

The color of the line.

Instance Method Summary collapse

Constructor Details

#initialize(x1:, y1:, x2:, y2:, color:) ⇒ Line

Creates a new Line.

x1

Start X (Numeric).

y1

Start Y (Numeric).

x2

End X (Numeric).

y2

End Y (Numeric).

color

Line color (Symbol).



70
71
72
# File 'lib/ratatui_ruby/widgets/canvas.rb', line 70

def initialize(x1:, y1:, x2:, y2:, color:)
  super(x1: Float(x1), y1: Float(y1), x2: Float(x2), y2: Float(y2), color:)
end