Class: KTextEditor::Cursor

Inherits:
Object show all
Defined in:
lib/ruber/ktexteditor_sugar.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Override of @Object#==@

Parameters:

  • other (Object)

    the object to compare with self

Returns:

  • (Boolean)

    true if other is a @KTextEditor::Cursor@ with the same line and column number and false otherwise



48
49
50
51
# File 'lib/ruber/ktexteditor_sugar.rb', line 48

def == other
  return false unless other.is_a? KTextEditor::Cursor
  line == other.line and column == other.column
end

#cloneCursor

Override of @Object#clone@

Returns:



67
68
69
70
71
# File 'lib/ruber/ktexteditor_sugar.rb', line 67

def clone
  res = dup
  res.freeze if self.frozen?
  res
end

#dupCursor

Override of @Object#dup@

Returns:



58
59
60
# File 'lib/ruber/ktexteditor_sugar.rb', line 58

def dup
  self.class.new self.line, self.column
end

#inspectString

Override of @Object#inspect@

Returns:

  • (String)

    a string representation of the cursor which displays line and column number



34
35
36
37
38
39
# File 'lib/ruber/ktexteditor_sugar.rb', line 34

def inspect
  if !disposed?
    "<#{self.class}:#{object_id} line=#{line} column=#{column}>"
  else "<#{self.class}:#{object_id} DISPOSED>"
  end
end