Cleaning up and writing tests
This commit is contained in:
+7
-1
@@ -16,7 +16,6 @@ class Position
|
||||
# initialize with a, b, c position
|
||||
raise NotImplementedError.new('(a, b, c) positioning not implimented!')
|
||||
else
|
||||
require 'byebug';debugger
|
||||
raise ArgumentError.new('Creation of a position requires two or three integer args for a position.')
|
||||
end
|
||||
end
|
||||
@@ -35,7 +34,14 @@ class Position
|
||||
return [x_pos, y_pos]
|
||||
end
|
||||
|
||||
# Returns the string formatted version
|
||||
#
|
||||
# @return [String] Returns a string representing the point.
|
||||
def to_s
|
||||
return "(#{@x_pos}, #{y_pos})"
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
return other.x_pos == @x_pos && other.y_pos == @y_pos
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user