Class: Shrine::Plugins::UrlsafeSerialization::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/shrine/plugins/_urlsafe_serialization.rb

Instance Method Summary collapse

Instance Method Details

#decode(data) ⇒ Object


66
67
68
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 66

def decode(data)
  json_decode(base64_decode(data))
end

#encode(data) ⇒ Object


62
63
64
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 62

def encode(data)
  base64_encode(json_encode(data))
end