Class: Paperclip::Storage::Dropbox::UrlGenerator
- Inherits:
-
Object
- Object
- Paperclip::Storage::Dropbox::UrlGenerator
- Defined in:
- lib/paperclip/storage/dropbox/url_generator.rb
Direct Known Subclasses
Instance Method Summary collapse
- #generate(style, options) ⇒ Object
-
#initialize(attachment, attachment_options) ⇒ UrlGenerator
constructor
A new instance of UrlGenerator.
Constructor Details
#initialize(attachment, attachment_options) ⇒ UrlGenerator
Returns a new instance of UrlGenerator.
8 9 10 11 |
# File 'lib/paperclip/storage/dropbox/url_generator.rb', line 8 def initialize(, ) = = end |
Instance Method Details
#generate(style, options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/paperclip/storage/dropbox/url_generator.rb', line 13 def generate(style, ) if .present? url = file_url(style) url = URI.parse(url) url.query = [url.query, "dl=1"].compact.join("&") if [:download] url.to_s else [:interpolator].interpolate([:default_url], , style) end end |