------ art_47904_11930450.1169989015494
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
How about:
class Vault
attr_accessor :unvault
def initialize val
@unvault al
end
end
class Object
def to_vault
Vault.new(self)
end
end
def change_me(obj)
obj.unvault + rocks!"
end
o Ruby".to_vault
change_me(o)
p o.unvault
$ ruby vault-test.rb
"Ruby rocks!"
On 1/27/07, Andy Koch <andy.koch / pc-doctor.com> wrote:
>
> Hello,
>
> Is there a way to pass variables by reference into function.
>
> I have large string to pass and the pass by value seems to be eating up
> too much memory.
>
> Thanks,
>
> Andy
>
>
>
------ art_47904_11930450.1169989015494--