Class: FrontKit::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/frontkit-rails/serializer.rb

Instance Method Summary collapse

Instance Method Details

#decode(str) ⇒ Object



11
12
13
# File 'lib/frontkit-rails/serializer.rb', line 11

def decode(str)
  MultiJson.decode(Base64.decode64(str))
end

#encode(hash) ⇒ Object



7
8
9
# File 'lib/frontkit-rails/serializer.rb', line 7

def encode(hash)
  Base64.encode64(MultiJson.encode(hash)).gsub(/\s+/, '')
end