class RatatuiRuby::Layout::Size

Terminal dimensions as width and height.

Layout calculations need sizes. Passing width and height as separate arguments is verbose and easy to swap by mistake.

This class bundles dimensions into a single immutable object. Extract it from a Rect or create it directly for sizing operations.

Use it for terminal dimensions, widget sizing constraints, or anywhere you need width/height without position.

Example

size = Layout::Size.new(width: 80, height: 24)
puts "Terminal is #{size.width} columns by #{size.height} rows"

# Extract from a Rect
rect = Layout::Rect.new(x: 10, y: 5, width: 80, height: 24)
size = rect.as_size # => Size(width: 80, height: 24)