We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab7aa9b commit 3b13ac0Copy full SHA for 3b13ac0
1 file changed
docs/index.md
@@ -46,12 +46,12 @@ class Foo(YamlAble):
46
""" String representation for prints """
47
return "Foo - " + str(dict(a=self.a, b=self.b))
48
49
- def to_yaml_dict(self):
+ def __to_yaml_dict__(self):
50
""" This optional method is called when you call yaml.dump()"""
51
return {'a': self.a, 'b': self.b}
52
53
@classmethod
54
- def from_yaml_dict(cls, dct, yaml_tag):
+ def __from_yaml_dict__(cls, dct, yaml_tag):
55
""" This optional method is called when you call yaml.load()"""
56
return Foo(dct['a'], dct['b'])
57
```
0 commit comments