Class: DXRubyEditor::EditorContext

Inherits:
Object
  • Object
show all
Defined in:
lib/dxruby_editor/editor_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name, str) ⇒ EditorContext

Returns a new instance of EditorContext.

Parameters:

  • file_name (String)
  • text (String)


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_xObject

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_yObject

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_nameObject (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

#strObject

Returns the value of attribute str.



3
4
5
# File 'lib/dxruby_editor/editor_context.rb', line 3

def str
  @str
end

#tab_sizeObject

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

#textObject

Returns the value of attribute text.



3
4
5
# File 'lib/dxruby_editor/editor_context.rb', line 3

def text
  @text
end

#tickObject

Returns the value of attribute tick.



4
5
6
# File 'lib/dxruby_editor/editor_context.rb', line 4

def tick
  @tick
end