B
Ben Giddings
Hi all,
I have a quick question about YAML. From the documentation it seems as
though it was designed for, or is well suited to saving/restoring an
object's state, but from looking at it I can't quite tell what the ideal
way of doing this is. Say I have a class that looks like:
class Foo
attr_accessor :bar, :arr, :buzz
def initialize
@bar = true
@arr = []
@buzz = "Here is some string"
end
end
What would the "save" and "load" methods of that class look like if I
wanted to use YAML?
Ben
I have a quick question about YAML. From the documentation it seems as
though it was designed for, or is well suited to saving/restoring an
object's state, but from looking at it I can't quite tell what the ideal
way of doing this is. Say I have a class that looks like:
class Foo
attr_accessor :bar, :arr, :buzz
def initialize
@bar = true
@arr = []
@buzz = "Here is some string"
end
end
What would the "save" and "load" methods of that class look like if I
wanted to use YAML?
Ben