class Point attr_accessor :x, :y def initialize( x, y ) @x = x @y = y end def to_s "(#{@x}, #{@y})" end end # inheritance is signified with the < symbol class Rectangle < Point attr_accessor :width, :height def initialize( width, height ) @width = width @height = height end def to_s "#{@width} x #{@height} @ #{super.to_s}" end end # ruby doesn't have multiple inheritance, but it does have modules and mixins