Class: Bulldog::SavedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/bulldog/saved_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ SavedFile

Returns a new instance of SavedFile.



3
4
5
6
# File 'lib/bulldog/saved_file.rb', line 3

def initialize(path, options={})
  @path = path
  @file_name = options[:file_name]
end

Instance Attribute Details

#file_nameObject (readonly)

The original file name as it was uploaded, if any.



13
14
15
# File 'lib/bulldog/saved_file.rb', line 13

def file_name
  @file_name
end

#pathObject (readonly)

Returns the value of attribute path.



8
9
10
# File 'lib/bulldog/saved_file.rb', line 8

def path
  @path
end

Instance Method Details

#sizeObject



15
16
17
# File 'lib/bulldog/saved_file.rb', line 15

def size
  File.size(path)
end