class Point
attr_accessor :x, :y
def initialize(x, y)
@x, @y = x, y
end
def <(other)
@x < other.x and
@y < other.y
end
def >(other)
@x > other.x and
@y > other.y
end
end
p1 = Point.new(1, 2)
p2 = Point.new(2, 3)
b1 = p1 > p2
# b1 is false
b2 = p1 < p2
# b2 is true
puts "b1 is #{b1}"
puts "b2 is #{b2}"