Class: Maildir::Serializer::JSON
- Defined in:
- lib/maildir/serializer/json.rb
Overview
Serialize messages as JSON
Instance Method Summary collapse
-
#dump(data, path) ⇒ Object
Dump data as JSON and writes it to path.
-
#load(path) ⇒ Object
Read data from path and parse it as JSON.
Instance Method Details
#dump(data, path) ⇒ Object
Dump data as JSON and writes it to path.
10 11 12 |
# File 'lib/maildir/serializer/json.rb', line 10 def dump(data, path) super(data.to_json, path) end |
#load(path) ⇒ Object
Read data from path and parse it as JSON.
5 6 7 |
# File 'lib/maildir/serializer/json.rb', line 5 def load(path) ::JSON.load(super(path)) end |