Class: Goodcheck::Location
- Inherits:
-
Object
- Object
- Goodcheck::Location
- Defined in:
- lib/goodcheck/location.rb
Instance Attribute Summary collapse
-
#end_column ⇒ Object
readonly
Returns the value of attribute end_column.
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#start_column ⇒ Object
readonly
Returns the value of attribute start_column.
-
#start_line ⇒ Object
readonly
Returns the value of attribute start_line.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(start_line:, start_column:, end_line:, end_column:) ⇒ Location
constructor
A new instance of Location.
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_column ⇒ Object (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_line ⇒ Object (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_column ⇒ Object (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_line ⇒ Object (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 |