W
Wayne Magor
It isn't possible to define a class method [] (to make a constructor)
for a struct is it?
If you have:
Customer = Struct.new( "Customer", :name, :address, :zip )
joe = Customer.new( "Joe Smith", "123 Maple, Anytown NC", 12345 )
but you want it to be:
joe = ["Joe Smith", "123 Maple, Anytown NC", 12345]
Ruby will just make joe an array, right? No way around this that I
can see, is there?
for a struct is it?
If you have:
Customer = Struct.new( "Customer", :name, :address, :zip )
joe = Customer.new( "Joe Smith", "123 Maple, Anytown NC", 12345 )
but you want it to be:
joe = ["Joe Smith", "123 Maple, Anytown NC", 12345]
Ruby will just make joe an array, right? No way around this that I
can see, is there?