Class: Paperclip::AbstractAdapter
- Inherits:
-
Object
- Object
- Paperclip::AbstractAdapter
show all
- Defined in:
- lib/paperclip/io_adapters/abstract_adapter.rb
Constant Summary
collapse
- OS_RESTRICTED_CHARACTERS =
%r{[/:]}
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#content_type ⇒ Object
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
Also known as:
length
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
#assignment? ⇒ Boolean
32
33
34
|
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 32
def assignment?
true
end
|
#fingerprint ⇒ Object
11
12
13
|
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 11
def fingerprint
@fingerprint ||= Digest::MD5.file(path).to_s
end
|
#inspect ⇒ Object
19
20
21
|
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 19
def inspect
"#{self.class}: #{self.original_filename}"
end
|
#nil? ⇒ Boolean
28
29
30
|
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 28
def nil?
false
end
|
#read(length = nil, buffer = nil) ⇒ Object
15
16
17
|
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 15
def read(length = nil, buffer = nil)
@tempfile.read(length, buffer)
end
|