Class: Boar::Handlers::Downloads::Remote

Inherits:
Base
  • Object
show all
Defined in:
app/models/boar/handlers/downloads/remote.rb

Instance Attribute Summary

Attributes inherited from Base

#options, #provider_options

Attributes inherited from Generic

#configuration, #service

Instance Method Summary collapse

Methods inherited from Base

#class_key, #credentials_params, #finalize_path, #initialize, #load_credentials, #update_credentials

Methods inherited from Generic

#initialize

Methods included from Utils::Basic

#ensure_hash, #get_option, #interpolate

Constructor Details

This class inherits a constructor from Boar::Handlers::Downloads::Base

Instance Method Details

#call(path, entry, _, _, _) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'app/models/boar/handlers/downloads/remote.rb', line 11

def call(path, entry, _, _, _)
  # Get the url
  url = entry[:url]

  # We can't download a directory
  raise Boar::Exceptions::NotFound.new(path) if url.blank?

  # Redirect to the remote URL
  @service.controller.redirect_to(self.interpolate(url, {path: path, entry: entry, options: @provider_options}))
end