class Tolken::HashSerializer

Public Class Methods

dump(hash) click to toggle source
# File lib/tolken/hash_serializer.rb, line 6
def dump(hash)
  hash # ActiveRecord handles formatting this from a Ruby hash to psql jsonb
end
load(hash) click to toggle source
# File lib/tolken/hash_serializer.rb, line 10
def load(hash)
  hash = JSON.parse(hash) if hash.is_a?(String)
  (hash || {}).with_indifferent_access
end