Class: Omnizip::Formats::Rar::Models::RarVolume
- Inherits:
-
Object
- Object
- Omnizip::Formats::Rar::Models::RarVolume
- Defined in:
- lib/omnizip/formats/rar/models/rar_volume.rb
Overview
Represents a RAR volume in a multi-volume set
Instance Attribute Summary collapse
-
#archive_flags ⇒ Object
Returns the value of attribute archive_flags.
-
#is_first ⇒ Object
Returns the value of attribute is_first.
-
#is_last ⇒ Object
Returns the value of attribute is_last.
-
#path ⇒ Object
Returns the value of attribute path.
-
#size ⇒ Object
Returns the value of attribute size.
-
#volume_number ⇒ Object
Returns the value of attribute volume_number.
Instance Method Summary collapse
-
#exist? ⇒ Boolean
Check if file exists.
-
#file_size ⇒ Integer
Get volume file size.
-
#first? ⇒ Boolean
Check if this is the first volume.
-
#initialize(path, volume_number = 0) ⇒ RarVolume
constructor
Initialize RAR volume.
-
#last? ⇒ Boolean
Check if this is the last volume.
Constructor Details
#initialize(path, volume_number = 0) ⇒ RarVolume
Initialize RAR volume
16 17 18 19 20 21 22 23 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 16 def initialize(path, volume_number = 0) @path = path @volume_number = volume_number @is_first = false @is_last = false @size = nil @archive_flags = 0 end |
Instance Attribute Details
#archive_flags ⇒ Object
Returns the value of attribute archive_flags.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def archive_flags @archive_flags end |
#is_first ⇒ Object
Returns the value of attribute is_first.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def is_first @is_first end |
#is_last ⇒ Object
Returns the value of attribute is_last.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def is_last @is_last end |
#path ⇒ Object
Returns the value of attribute path.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def path @path end |
#size ⇒ Object
Returns the value of attribute size.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def size @size end |
#volume_number ⇒ Object
Returns the value of attribute volume_number.
9 10 11 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 9 def volume_number @volume_number end |
Instance Method Details
#exist? ⇒ Boolean
Check if file exists
49 50 51 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 49 def exist? File.exist?(@path) end |
#file_size ⇒ Integer
Get volume file size
42 43 44 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 42 def file_size @file_size ||= File.size(@path) end |
#first? ⇒ Boolean
Check if this is the first volume
28 29 30 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 28 def first? @is_first end |
#last? ⇒ Boolean
Check if this is the last volume
35 36 37 |
# File 'lib/omnizip/formats/rar/models/rar_volume.rb', line 35 def last? @is_last end |