Class: Paperclip::UriAdapter
- Inherits:
-
AbstractAdapter
- Object
- AbstractAdapter
- Paperclip::UriAdapter
- Defined in:
- lib/paperclip/io_adapters/uri_adapter.rb
Direct Known Subclasses
Constant Summary
Constants inherited from AbstractAdapter
AbstractAdapter::OS_RESTRICTED_CHARACTERS
Instance Attribute Summary collapse
-
#content_type ⇒ Object
writeonly
Sets the attribute content_type.
Attributes inherited from AbstractAdapter
#content_type, #original_filename, #size, #tempfile
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target, options = {}) ⇒ UriAdapter
constructor
A new instance of UriAdapter.
Methods inherited from AbstractAdapter
#assignment?, #fingerprint, #inspect, #nil?, #read
Constructor Details
#initialize(target, options = {}) ⇒ UriAdapter
Returns a new instance of UriAdapter.
13 14 15 16 17 18 |
# File 'lib/paperclip/io_adapters/uri_adapter.rb', line 13 def initialize(target, = {}) super @content = download_content cache_current_values @tempfile = copy_to_tempfile(@content) end |
Instance Attribute Details
#content_type=(value) ⇒ Object (writeonly)
Sets the attribute content_type
5 6 7 |
# File 'lib/paperclip/io_adapters/uri_adapter.rb', line 5 def content_type=(value) @content_type = value end |
Class Method Details
.register ⇒ Object
7 8 9 10 11 |
# File 'lib/paperclip/io_adapters/uri_adapter.rb', line 7 def self.register Paperclip.io_adapters.register self do |target| target.is_a?(URI) end end |