L
Laughlin, Joseph V
How can I do something like the following:
class Foo
attr_accessor :goo, :moo
def initalize
@attr.each { | attrib| attrib = 0 }
end
end
In case it's not clear, I want to set all attributes of the Foo object
to zero. But I can't seem to get the syntax for it correct.
Thanks,
Joe
class Foo
attr_accessor :goo, :moo
def initalize
@attr.each { | attrib| attrib = 0 }
end
end
In case it's not clear, I want to set all attributes of the Foo object
to zero. But I can't seem to get the syntax for it correct.
Thanks,
Joe