Class: Paperclip::AbstractAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/paperclip/io_adapters/abstract_adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



5
6
7
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 5

def content_type
  @content_type
end

#original_filenameObject (readonly)

Returns the value of attribute original_filename.



5
6
7
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 5

def original_filename
  @original_filename
end

#sizeObject (readonly)

Returns the value of attribute size.



5
6
7
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 5

def size
  @size
end

Instance Method Details

#fingerprintObject



8
9
10
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 8

def fingerprint
  @fingerprint ||= Digest::MD5.file(path).to_s
end

#inspectObject



16
17
18
# File 'lib/paperclip/io_adapters/abstract_adapter.rb', line 16

def inspect
  "#{self.class}: #{self.original_filename}"
end

#read(length = nil, buffer = nil) ⇒ Object



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

def read(length = nil, buffer = nil)
  @tempfile.read(length, buffer)
end