module Shrine::Plugins::DefaultStorage::AttacherMethods

Public Class Methods

new(**options) click to toggle source
Calls superclass method
# File lib/shrine/plugins/default_storage.rb, line 29
def initialize(**options)
  super(**shrine_class.opts[:default_storage], **options)
end

Public Instance Methods

cache_key() click to toggle source
Calls superclass method
# File lib/shrine/plugins/default_storage.rb, line 33
def cache_key
  if @cache.respond_to?(:call)
    if @cache.arity == 2
      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.")
      @cache.call(record, name).to_sym
    else
      instance_exec(&@cache).to_sym
    end
  else
    super
  end
end
store_key() click to toggle source
Calls superclass method
# File lib/shrine/plugins/default_storage.rb, line 46
def store_key
  if @store.respond_to?(:call)
    if @store.arity == 2
      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.")
      @store.call(record, name).to_sym
    else
      instance_exec(&@store).to_sym
    end
  else
    super
  end
end