module Shrine::Plugins::DefaultStorage::AttacherMethods

  1. lib/shrine/plugins/default_storage.rb

Methods

Public Class

  1. new

Public Instance

  1. cache_key
  2. store_key

Public Class methods

new(**options)
[show source]
   # File lib/shrine/plugins/default_storage.rb
29 def initialize(**options)
30   super(**shrine_class.opts[:default_storage], **options)
31 end

Public Instance methods

cache_key()
[show source]
   # File lib/shrine/plugins/default_storage.rb
33 def cache_key
34   if @cache.respond_to?(:call)
35     if @cache.arity == 2
36       Shrine.deprecation("Passing record & name argument to default storage block is deprecated and will be removed in Shrine 4. Use a block without arguments instead.")
37       @cache.call(record, name).to_sym
38     else
39       instance_exec(&@cache).to_sym
40     end
41   else
42     super
43   end
44 end
store_key()
[show source]
   # File lib/shrine/plugins/default_storage.rb
46 def store_key
47   if @store.respond_to?(:call)
48     if @store.arity == 2
49       Shrine.deprecation("Passing record & name argument to default storage block is deprecated and will be removed in Shrine 4. Use a block without arguments instead.")
50       @store.call(record, name).to_sym
51     else
52       instance_exec(&@store).to_sym
53     end
54   else
55     super
56   end
57 end