simplify.domain.PaymentObjectEncoder

Package simplify :: Module domain :: Class PaymentObjectEncoder |
[hide private]
[frames] | no frames]

# Class PaymentObjectEncoder

source code

                  object --+
                           |
    json.encoder.JSONEncoder --+
                               |
                              PaymentObjectEncoder

Instance Methods | [hide private]
default(self, obj) Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). | source code
Inherited from `json.encoder.JSONEncoder`: `__init__`, `encode`, `iterencode` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables | [hide private]
Inherited from `json.encoder.JSONEncoder`: `item_separator`, `key_separator`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### default(self, obj) | source code
Implement this method in a subclass such that it returns a serializable object for ``o``, or calls the base implementation (to raise a ``TypeError``). For example, to support arbitrary iterators, you could implement default like this:
       def default(self, o):
           try:
               iterable = iter(o)
           except TypeError:
               pass
           else:
               return list(iterable)
           # Let the base class default method raise the TypeError
           return JSONEncoder.default(self, o)
Overrides: json.encoder.JSONEncoder.default (inherited documentation)