Class: Goodcheck::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/goodcheck/location.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_line:, start_column:, end_line:, end_column:) ⇒ Location

Returns a new instance of Location.



8
9
10
11
12
13
# File 'lib/goodcheck/location.rb', line 8

def initialize(start_line:, start_column:, end_line:, end_column:)
  @start_line = start_line
  @start_column = start_column
  @end_line = end_line
  @end_column = end_column
end

Instance Attribute Details

#end_columnObject (readonly)

Returns the value of attribute end_column.



6
7
8
# File 'lib/goodcheck/location.rb', line 6

def end_column
  @end_column
end

#end_lineObject (readonly)

Returns the value of attribute end_line.



5
6
7
# File 'lib/goodcheck/location.rb', line 5

def end_line
  @end_line
end

#start_columnObject (readonly)

Returns the value of attribute start_column.



4
5
6
# File 'lib/goodcheck/location.rb', line 4

def start_column
  @start_column
end

#start_lineObject (readonly)

Returns the value of attribute start_line.



3
4
5
# File 'lib/goodcheck/location.rb', line 3

def start_line
  @start_line
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/goodcheck/location.rb', line 15

def ==(other)
  other.is_a?(Location) &&
    other.start_line == start_line &&
    other.start_column == start_column &&
    other.end_line == end_line &&
    other.end_column == end_column
end