Class: RatatuiRuby::TestHelper::TestDoubles::StubRect

Inherits:
Data
  • Object
show all
Defined in:
lib/ratatui_ruby/test_helper/test_doubles.rb

Overview

Stub rect with fixed dimensions.

x

Integer left edge (default: 0).

y

Integer top edge (default: 0).

width

Integer width in cells (default: 80).

height

Integer height in cells (default: 24).

Example

area = StubRect.new(width: 60, height: 20)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x: 0, y: 0, width: 80, height: 24) ⇒ StubRect

Returns a new instance of StubRect.



80
81
82
# File 'lib/ratatui_ruby/test_helper/test_doubles.rb', line 80

def initialize(x: 0, y: 0, width: 80, height: 24)
  super
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



79
80
81
# File 'lib/ratatui_ruby/test_helper/test_doubles.rb', line 79

def height
  @height
end

#widthObject (readonly)

Returns the value of attribute width

Returns:

  • (Object)

    the current value of width



79
80
81
# File 'lib/ratatui_ruby/test_helper/test_doubles.rb', line 79

def width
  @width
end

#xObject (readonly)

Returns the value of attribute x

Returns:

  • (Object)

    the current value of x



79
80
81
# File 'lib/ratatui_ruby/test_helper/test_doubles.rb', line 79

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y

Returns:

  • (Object)

    the current value of y



79
80
81
# File 'lib/ratatui_ruby/test_helper/test_doubles.rb', line 79

def y
  @y
end