module Shrine::Plugins::DerivationEndpoint::FileMethods

  1. lib/shrine/plugins/derivation_endpoint.rb

Public Instance methods

derivation(name, *args, **options)

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

[show source]
    # File lib/shrine/plugins/derivation_endpoint.rb
104 def derivation(name, *args, **options)
105   Shrine::Derivation.new(
106     name:    name,
107     args:    args,
108     source:  self,
109     options: options,
110   )
111 end
derivation_response(name, *args, env:, **options)

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

[show source]
   # File lib/shrine/plugins/derivation_endpoint.rb
97 def derivation_response(name, *args, env:, **options)
98   derivation(name, *args, **options).response(env)
99 end
derivation_url(name, *args, **options)

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.

[show source]
   # File lib/shrine/plugins/derivation_endpoint.rb
90 def derivation_url(name, *args, **options)
91   derivation(name, *args).url(**options)
92 end