Tarscher wrote:
> Thanks for the answer.
>
> I can get the serialized object out of the database but it is now in
> YAML format. How can I convert this back into my vlass object?
>
> Thanks
>
> On Apr 10, 5:49�pm, Frederick Cheung <[EMAIL PROTECTED]>
Look at the Marshal module. From the API docs:
class Klass
def initialize(str)
@str = str
end
def sayHello
@str
end
end
(produces no output)
o = Klass.new("hello\n")
data = Marshal.dump(o)
obj = Marshal.load(data)
obj.sayHello #=> "hello\n"
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---