Class: JarEd::Screen
- Inherits:
-
Object
- Object
- JarEd::Screen
- Defined in:
- lib/jared/screen.rb
Instance Attribute Summary collapse
-
#cursor_column ⇒ Object
readonly
Returns the value of attribute cursor_column.
-
#cursor_row ⇒ Object
readonly
Returns the value of attribute cursor_row.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(lines:, cursor_column:, cursor_row:) ⇒ Screen
constructor
A new instance of Screen.
- #width ⇒ Object
Constructor Details
#initialize(lines:, cursor_column:, cursor_row:) ⇒ Screen
TODO:
Rename these to cursor_row/column
Returns a new instance of Screen.
6 7 8 9 10 |
# File 'lib/jared/screen.rb', line 6 def initialize(lines:, cursor_column:, cursor_row:) @lines = lines @cursor_column = cursor_column @cursor_row = cursor_row end |
Instance Attribute Details
#cursor_column ⇒ Object (readonly)
Returns the value of attribute cursor_column.
3 4 5 |
# File 'lib/jared/screen.rb', line 3 def cursor_column @cursor_column end |
#cursor_row ⇒ Object (readonly)
Returns the value of attribute cursor_row.
3 4 5 |
# File 'lib/jared/screen.rb', line 3 def cursor_row @cursor_row end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
3 4 5 |
# File 'lib/jared/screen.rb', line 3 def lines @lines end |
Instance Method Details
#height ⇒ Object
16 17 18 |
# File 'lib/jared/screen.rb', line 16 def height lines.length end |
#width ⇒ Object
12 13 14 |
# File 'lib/jared/screen.rb', line 12 def width lines.map(&:length).max end |