Module: Shrine::Plugins::UrlsafeSerialization::ClassMethods

Defined in:
lib/shrine/plugins/_urlsafe_serialization.rb

Instance Method Summary collapse

Instance Method Details

#urlsafe_deserialize(string) ⇒ Object


16
17
18
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 16

def urlsafe_deserialize(string)
  urlsafe_serializer.decode(string)
end

#urlsafe_serialize(hash) ⇒ Object


12
13
14
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 12

def urlsafe_serialize(hash)
  urlsafe_serializer.encode(hash)
end

#urlsafe_serializerObject


20
21
22
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 20

def urlsafe_serializer
  Serializer.new
end