Closed jacebrowning closed 9 years ago
Converter
(immutable) should have to_value
/to_data
.
Convertible
(mutable) should extend Converter
and add apply_value
/format_data
:
to_value
simply calls and returns apply_value
on a new instanceformat_data
simply calls and returns to_data
During "store", to_data
is always called on the converter class.
During "fetch", apply_value
is called on the attribute if it's an instance of the converter class and the converter class subclasses Convertible
, else to_value
is called on the converter class.
Fixes #47