Class: Maildir::Serializer::JSON

Inherits:
Base
  • Object
show all
Defined in:
lib/maildir/serializer/json.rb

Overview

Serialize messages as JSON

Instance Method Summary collapse

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