What are you trying to do?
You can create your own class:
class Boat end
If you need an easy way to make a class for storing data, use struct:
class Boat < Struct.new(:name, :speed) end b = Boat.new "Martha", 31
You cannot declare an argument class of a variable or method, as you can in C. Instead, you can check the type at runtime:
b.is_a?(Boat)
David grayson
source share