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.
18 19 20 |
# File 'lib/maildir/serializer/json.rb', line 18 def dump(data, path) super(data.to_json, path) end |
#load(path) ⇒ Object
Read data from path and parse it as JSON.
13 14 15 |
# File 'lib/maildir/serializer/json.rb', line 13 def load(path) ::JSON.load(super(path)) end |