Class: DXRubyEditor::EditorContext
- Inherits:
-
Object
- Object
- DXRubyEditor::EditorContext
- Defined in:
- lib/dxruby_editor/editor_context.rb
Instance Attribute Summary collapse
-
#cursor_x ⇒ Object
Returns the value of attribute cursor_x.
-
#cursor_y ⇒ Object
Returns the value of attribute cursor_y.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#str ⇒ Object
Returns the value of attribute str.
-
#tab_size ⇒ Object
Returns the value of attribute tab_size.
-
#text ⇒ Object
Returns the value of attribute text.
-
#tick ⇒ Object
Returns the value of attribute tick.
Instance Method Summary collapse
-
#initialize(file_name, str) ⇒ EditorContext
constructor
A new instance of EditorContext.
Constructor Details
#initialize(file_name, str) ⇒ EditorContext
Returns a new instance of EditorContext.
8 9 10 11 12 13 14 15 16 |
# File 'lib/dxruby_editor/editor_context.rb', line 8 def initialize(file_name, str) @file_name = file_name @str = str @text = str.split(/\R/) @cursor_x = 1 @cursor_y = 1 @tab_size = 2 @tick = 0 end |
Instance Attribute Details
#cursor_x ⇒ Object
Returns the value of attribute cursor_x.
4 5 6 |
# File 'lib/dxruby_editor/editor_context.rb', line 4 def cursor_x @cursor_x end |
#cursor_y ⇒ Object
Returns the value of attribute cursor_y.
4 5 6 |
# File 'lib/dxruby_editor/editor_context.rb', line 4 def cursor_y @cursor_y end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
3 4 5 |
# File 'lib/dxruby_editor/editor_context.rb', line 3 def file_name @file_name end |
#str ⇒ Object
Returns the value of attribute str.
3 4 5 |
# File 'lib/dxruby_editor/editor_context.rb', line 3 def str @str end |
#tab_size ⇒ Object
Returns the value of attribute tab_size.
4 5 6 |
# File 'lib/dxruby_editor/editor_context.rb', line 4 def tab_size @tab_size end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/dxruby_editor/editor_context.rb', line 3 def text @text end |
#tick ⇒ Object
Returns the value of attribute tick.
4 5 6 |
# File 'lib/dxruby_editor/editor_context.rb', line 4 def tick @tick end |