Another way is Struct to determine Pair.
Pair = Struct.new(:x, :y) do
def to_s
"(#{x}, #{y})"
end
end
Then yon can use it as other built-in data structures. [Pair.new(0,0), Pair.new(1,1)].
, Pair , Pair.
def Pair(x, y)
Pair.new(x, y)
end
, [Pair(0,0), Pair(1,1)]