Skip to content

Commit f97b9a0

Browse files
committed
Add Point#==
1 parent 15241af commit f97b9a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ruby_snake/point.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,9 @@ def initialize(x, y)
1212
def to_ary
1313
[x, y]
1414
end
15+
16+
def ==(other)
17+
@x == other.x && @y == other.y
18+
end
1519
end
1620
end

0 commit comments

Comments
 (0)