Class: Paperclip::UriAdapter

Inherits:
AbstractAdapter show all
Defined in:
lib/paperclip/io_adapters/uri_adapter.rb

Direct Known Subclasses

HttpUrlProxyAdapter

Constant Summary

Constant Summary

Constants inherited from AbstractAdapter

AbstractAdapter::OS_RESTRICTED_CHARACTERS

Instance Attribute Summary (collapse)

Attributes inherited from AbstractAdapter

#content_type, #original_filename, #size

Instance Method Summary (collapse)

Methods inherited from AbstractAdapter

#assignment?, #fingerprint, #inspect, #nil?, #read

Constructor Details

- (UriAdapter) initialize(target)

Returns a new instance of UriAdapter



5
6
7
8
9
10
# File 'lib/paperclip/io_adapters/uri_adapter.rb', line 5

def initialize(target)
  @target = target
  @content = download_content
  cache_current_values
  @tempfile = copy_to_tempfile(@content)
end

Instance Attribute Details

- (Object) content_type=(value) (writeonly)

Sets the attribute content_type

Parameters:

  • value

    the value to set the attribute content_type to.



12
13
14
# File 'lib/paperclip/io_adapters/uri_adapter.rb', line 12

def content_type=(value)
  @content_type = value
end