Class: KTextEditor::Range

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::Range@ with the same start and end and false otherwise



97
98
99
100
# File 'lib/ruber/ktexteditor_sugar.rb', line 97

def == other
  return false unless other.is_a? KTextEditor::Range
  start == other.start and self.end == other.end
end

#cloneRange

Override of @Object#clone@

Returns:



116
117
118
119
120
# File 'lib/ruber/ktexteditor_sugar.rb', line 116

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

#dupRange

Override of @Object#dup@

Returns:



107
108
109
# File 'lib/ruber/ktexteditor_sugar.rb', line 107

def dup
  self.class.new self.start, self.end
end

#inspectString

Override of @Object#inspect@

Returns:

  • (String)

    a string representation of the cursor which displays the start and end line and column



83
84
85
86
87
88
# File 'lib/ruber/ktexteditor_sugar.rb', line 83

def inspect
  return "<#{self.class}:#{object_id} DISPOSED>" if disposed?
  start_c = self.start
  end_c = self.end
  "<#{self.class}:#{object_id} start=(#{start_c.line};#{start_c.column}) end=(#{end_c.line};#{end_c.column})>"
end