Class: UploadInfo
- Inherits:
-
Object
- Object
- UploadInfo
- 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
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#bytes_hash ⇒ Object
readonly
Returns the value of attribute bytes_hash.
-
#num_files ⇒ Object
readonly
Returns the value of attribute num_files.
Instance Method Summary collapse
-
#initialize(files_with_path) ⇒ UploadInfo
constructor
A new instance of UploadInfo.
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
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes.
8 9 10 |
# File 'lib/piggy-core/upload_info.rb', line 8 def bytes @bytes end |
#bytes_hash ⇒ Object (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_files ⇒ Object (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 |