Class: UploadInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/piggy-core/upload_info.rb

Overview

This file is used to compute byte sizes of a set of given files and directories. The size of directories is computed recursively.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(files_with_path) ⇒ UploadInfo

Returns a new instance of UploadInfo.



10
11
12
13
14
15
# File 'lib/piggy-core/upload_info.rb', line 10

def initialize(files_with_path)
  @bytes_hash = Hash.new
  @bytes = 0
  @num_files = 0
  add(files_with_path)
end

Instance Attribute Details

#bytesObject (readonly)

Returns the value of attribute bytes.



8
9
10
# File 'lib/piggy-core/upload_info.rb', line 8

def bytes
  @bytes
end

#bytes_hashObject (readonly)

Returns the value of attribute bytes_hash.



8
9
10
# File 'lib/piggy-core/upload_info.rb', line 8

def bytes_hash
  @bytes_hash
end

#num_filesObject (readonly)

Returns the value of attribute num_files.



8
9
10
# File 'lib/piggy-core/upload_info.rb', line 8

def num_files
  @num_files
end