Class: RubyTUI::ResizeEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/rubytui/event.rb

Overview

A terminal resize event carrying the new size in cells.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width:, height:) ⇒ ResizeEvent

Returns a new instance of ResizeEvent.

Parameters:

  • width (Integer) —

    new width in columns

  • height (Integer) —

    new height in rows



152
153
154
155
# File 'lib/rubytui/event.rb', line 152

def initialize(width:, height:)
  @width = width
  @height = height
end

Instance Attribute Details

#height ⇒ Object (readonly)

Returns the value of attribute height.



148
149
150
# File 'lib/rubytui/event.rb', line 148

def height
  @height
end

#width ⇒ Object (readonly)

Returns the value of attribute width.



148
149
150
# File 'lib/rubytui/event.rb', line 148

def width
  @width
end

Instance Method Details

#to_s ⇒ String Also known as: inspect

Returns human-readable form, e.g. ResizeEvent(80x24).

Returns:

  • (String) —

    human-readable form, e.g. ResizeEvent(80x24)



158
# File 'lib/rubytui/event.rb', line 158

def to_s = "ResizeEvent(#{@width}x#{@height})"