lib/robot/point.rb in robot_rea-0.1.5 vs lib/robot/point.rb in robot_rea-0.1.6
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Point value object
module Robot
class Point
attr_reader :x, :y
@@ -23,19 +25,19 @@
def west
Point.new(x: x - 1, y: y)
end
- def ==(point)
- x == point.x && y == point.y
+ def ==(other)
+ x == other.x && y == other.y
end
- def >(point)
- x > point.x || y > point.y
+ def >(other)
+ x > other.x || y > other.y
end
- def <(point)
- x < point.x || y < point.y
+ def <(other)
+ x < other.x || y < other.y
end
def to_s
"#{x}, #{y}"
end