Class: Paperclip::HttpUrlProxyAdapter
- Inherits:
-
UriAdapter
- Object
- AbstractAdapter
- UriAdapter
- Paperclip::HttpUrlProxyAdapter
- Defined in:
- lib/paperclip/io_adapters/http_url_proxy_adapter.rb
Constant Summary collapse
- REGEXP =
/\Ahttps?:\/\//.freeze
Constants inherited from AbstractAdapter
AbstractAdapter::OS_RESTRICTED_CHARACTERS
Instance Attribute Summary
Attributes inherited from UriAdapter
Attributes inherited from AbstractAdapter
#content_type, #original_filename, #size, #tempfile
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target, options = {}) ⇒ HttpUrlProxyAdapter
constructor
A new instance of HttpUrlProxyAdapter.
Methods inherited from AbstractAdapter
#assignment?, #fingerprint, #inspect, #nil?, #read
Constructor Details
#initialize(target, options = {}) ⇒ HttpUrlProxyAdapter
Returns a new instance of HttpUrlProxyAdapter.
11 12 13 14 |
# File 'lib/paperclip/io_adapters/http_url_proxy_adapter.rb', line 11 def initialize(target, = {}) escaped = Paperclip::UrlGenerator.escape(target) super(URI(target == Paperclip::UrlGenerator.unescape(target) ? escaped : target), ) end |
Class Method Details
.register ⇒ Object
3 4 5 6 7 |
# File 'lib/paperclip/io_adapters/http_url_proxy_adapter.rb', line 3 def self.register Paperclip.io_adapters.register self do |target| String === target && target =~ REGEXP end end |