Skip to content

Commit 3b13ac0

Browse files
committed
Updated documentation with new dunder methods
1 parent ab7aa9b commit 3b13ac0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class Foo(YamlAble):
4646
""" String representation for prints """
4747
return "Foo - " + str(dict(a=self.a, b=self.b))
4848

49-
def to_yaml_dict(self):
49+
def __to_yaml_dict__(self):
5050
""" This optional method is called when you call yaml.dump()"""
5151
return {'a': self.a, 'b': self.b}
5252

5353
@classmethod
54-
def from_yaml_dict(cls, dct, yaml_tag):
54+
def __from_yaml_dict__(cls, dct, yaml_tag):
5555
""" This optional method is called when you call yaml.load()"""
5656
return Foo(dct['a'], dct['b'])
5757
```

0 commit comments

Comments
 (0)