Class: SerializedHashie::Hash

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/serialized_hashie/hash.rb

Class Method Summary collapse

Class Method Details

.dump(obj) ⇒ Object



12
13
14
15
# File 'lib/serialized_hashie/hash.rb', line 12

def dump(obj)
  hash = dump_hash(obj)
  hash.to_json
end

.load(raw_hash) ⇒ Object



17
18
19
20
21
# File 'lib/serialized_hashie/hash.rb', line 17

def load(raw_hash)
  hash = JSON.parse(presence(raw_hash) || '{}')
  hash = load_hash(hash)
  new(hash)
end