Class: JSON::Store

Inherits:
PStore
  • Object
show all
Defined in:
lib/ver/vendor/json_store.rb

Constant Summary collapse

EMPTY_MARSHAL_DATA =
{}.to_json
EMPTY_MARSHAL_CHECKSUM =
Digest::MD5.digest(EMPTY_MARSHAL_DATA)

Instance Method Summary collapse

Instance Method Details

#dump(table) ⇒ Object



5
6
7
# File 'lib/ver/vendor/json_store.rb', line 5

def dump(table)
  JSON.pretty_unparse(@table)
end

#empty_marshal_checksumObject



20
21
22
# File 'lib/ver/vendor/json_store.rb', line 20

def empty_marshal_checksum
  EMPTY_MARSHAL_CHECKSUM
end

#empty_marshal_dataObject



16
17
18
# File 'lib/ver/vendor/json_store.rb', line 16

def empty_marshal_data
  EMPTY_MARSHAL_DATA
end

#load(content) ⇒ Object



9
10
11
# File 'lib/ver/vendor/json_store.rb', line 9

def load(content)
  JSON.load(content)
end