module Shrine::Plugins::DerivationEndpoint::FileMethods

Public Instance Methods

derivation(name, *args, **options) click to toggle source

Returns a Shrine::Derivation object created from the provided arguments. This object offers additional methods for operating with derivatives on a lower level.

# File lib/shrine/plugins/derivation_endpoint.rb, line 104
def derivation(name, *args, **options)
  Shrine::Derivation.new(
    name:    name,
    args:    args,
    source:  self,
    options: options,
  )
end
derivation_response(name, *args, env:, **options) click to toggle source

Calls the specified derivation with the receiver as the source file, returning a Rack response triple. The derivation endpoint ultimately calls this method.

# File lib/shrine/plugins/derivation_endpoint.rb, line 97
def derivation_response(name, *args, env:, **options)
  derivation(name, *args, **options).response(env)
end
derivation_url(name, *args, **options) click to toggle source

Generates a URL to a derivation with the receiver as the source file. Any arguments provided will be included in the URL and passed to the derivation block. Accepts additional URL options.

# File lib/shrine/plugins/derivation_endpoint.rb, line 90
def derivation_url(name, *args, **options)
  derivation(name, *args).url(**options)
end