Class: JarEd::Buffer
- Inherits:
-
Object
- Object
- JarEd::Buffer
- Defined in:
- lib/jared/buffer.rb
Instance Attribute Summary collapse
-
#cursor_column ⇒ Object
readonly
Returns the value of attribute cursor_column.
-
#cursor_line ⇒ Object
readonly
Returns the value of attribute cursor_line.
-
#window_position ⇒ Object
readonly
Returns the value of attribute window_position.
Instance Method Summary collapse
-
#initialize(file) ⇒ Buffer
constructor
A new instance of Buffer.
- #lines ⇒ Object
Constructor Details
#initialize(file) ⇒ Buffer
Returns a new instance of Buffer.
7 8 9 10 11 12 |
# File 'lib/jared/buffer.rb', line 7 def initialize(file) @file = file @window_position = 0 @cursor_line = 0 @cursor_column = 0 end |
Instance Attribute Details
#cursor_column ⇒ Object (readonly)
Returns the value of attribute cursor_column.
3 4 5 |
# File 'lib/jared/buffer.rb', line 3 def cursor_column @cursor_column end |
#cursor_line ⇒ Object (readonly)
Returns the value of attribute cursor_line.
3 4 5 |
# File 'lib/jared/buffer.rb', line 3 def cursor_line @cursor_line end |
#window_position ⇒ Object (readonly)
Returns the value of attribute window_position.
3 4 5 |
# File 'lib/jared/buffer.rb', line 3 def window_position @window_position end |
Instance Method Details
#lines ⇒ Object
14 15 16 |
# File 'lib/jared/buffer.rb', line 14 def lines @lines ||= file.each_line.to_a end |