Module: Shrine::Plugins::UrlsafeSerialization::FileClassMethods

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

Instance Method Summary collapse

Instance Method Details

#urlsafe_dump(file, **options) ⇒ Object


48
49
50
51
52
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 48

def urlsafe_dump(file, **options)
  data = file.urlsafe_data(**options)

  shrine_class.urlsafe_serialize(data)
end

#urlsafe_load(string) ⇒ Object


54
55
56
57
58
# File 'lib/shrine/plugins/_urlsafe_serialization.rb', line 54

def urlsafe_load(string)
  data = shrine_class.urlsafe_deserialize(string)

  new(data)
end