Class: Paperclip::AbstractAdapter
- Inherits:
-
Object
- Object
- Paperclip::AbstractAdapter
- Defined in:
- lib/paperclip/io_adapters/abstract_adapter.rb
Direct Known Subclasses
AttachmentAdapter, FileAdapter, IdentityAdapter, NilAdapter, StringioAdapter, UploadedFileAdapter, UriAdapter
Constant Summary collapse
- OS_RESTRICTED_CHARACTERS =
%r{[/:]}
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#original_filename ⇒ Object
Returns the value of attribute original_filename.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
7 8 9 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 7 def content_type @content_type end |
#original_filename ⇒ Object
Returns the value of attribute original_filename.
7 8 9 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 7 def original_filename @original_filename end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
7 8 9 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 7 def size @size end |
Instance Method Details
#fingerprint ⇒ Object
10 11 12 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 10 def fingerprint @fingerprint ||= Digest::MD5.file(path).to_s end |
#inspect ⇒ Object
18 19 20 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 18 def inspect "#{self.class}: #{self.original_filename}" end |
#read(length = nil, buffer = nil) ⇒ Object
14 15 16 |
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 14 def read(length = nil, buffer = nil) @tempfile.read(length, buffer) end |