Topic: Help! Class Design

I have 3 classes ("Truck", "Semi", "Motorcycle") that all inherit from the "Vehicle" class.

Each subclass has an attribute for "Wheels" that tells how many wheels the vehicle has (I do not store these values in the database because they will never change)

I'm wondering what is the preferred method for handling this?  Right now I have individual methods in each class for "Wheels"

For example:

class Truck
  def wheels
    4
  end
end

class Motorcycle
  def wheels
    2
  end
end

class Semi
  def wheels
    18
  end
end

Is there a better way???  Thanks

Last edited by OliverB (2013-05-25 02:20:57)