class Point attr_accessor :x attr_accessor :y def initialize x, y @x = x @y = y end def inverted return Point.new @y, @x end end