Class: Steep::Services::ContentChange::Position

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/services/content_change.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line:, column:) ⇒ Position

Returns a new instance of Position.



7
8
9
10
# File 'lib/steep/services/content_change.rb', line 7

def initialize(line:, column:)
  @line = line
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



5
6
7
# File 'lib/steep/services/content_change.rb', line 5

def column
  @column
end

#lineObject (readonly)

Returns the value of attribute line.



5
6
7
# File 'lib/steep/services/content_change.rb', line 5

def line
  @line
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



12
13
14
# File 'lib/steep/services/content_change.rb', line 12

def ==(other)
  other.is_a?(Position) && other.line == line && other.column == column
end

#hashObject



18
19
20
# File 'lib/steep/services/content_change.rb', line 18

def hash
  self.class.hash ^ line ^ column
end