Class: Filezor::File

Inherits:
Object
  • Object
show all
Defined in:
lib/filezor/file.rb

Overview

A File that knows its MD5 hash, and target upload path.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tempfile, path, hash = nil) ⇒ File

Returns a new instance of File.



6
7
8
9
10
# File 'lib/filezor/file.rb', line 6

def initialize(tempfile, path, hash = nil)
  @tempfile = tempfile
  @path = path
  @md5 = hash || Filezor::Util::md5(tempfile)
end

Instance Attribute Details

#md5Object

Returns the value of attribute md5.



4
5
6
# File 'lib/filezor/file.rb', line 4

def md5
  @md5
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/filezor/file.rb', line 4

def path
  @path
end

#tempfileObject

Returns the value of attribute tempfile.



4
5
6
# File 'lib/filezor/file.rb', line 4

def tempfile
  @tempfile
end