Nobuyoshi Nakada
11/17/2006 10:51:00 AM
Hi,
At Fri, 17 Nov 2006 03:30:40 +0900,
Giles Bowkett wrote in [ruby-talk:225339]:
> is there an easy, elegant way to set up a Struct so it has defaults on
> initialization?
>
> (besides def initialize?)
class User < Struct.new(:name, :uid)
def initialize(name = 'Bob', uid = 1234)
super
end
end
--
Nobu Nakada