Module: Shrine::Plugins::Transloadit::FileMethods

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

Instance Method Summary collapse

Instance Method Details

#transloadit_responseObject

Converts the “transloadit_response” that was saved in cached file’s metadata into a reloadable object which is normally returned by the Transloadit gem.



329
330
331
332
333
334
335
336
337
# File 'lib/shrine/plugins/transloadit.rb', line 329

def transloadit_response
  @transloadit_response ||= (
    body = ["transloadit_response"] or return
    body.instance_eval { def body; self; end }
    response = ::Transloadit::Response.new(body)
    response.extend ::Transloadit::Response::Assembly
    response
  )
end