Class: Omnizip::Formats::Rar::Models::RarEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/formats/rar/models/rar_entry.rb

Overview

Represents a file entry in RAR archive Contains file metadata and extraction information

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRarEntry

Initialize RAR entry



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 16

def initialize
  @name = nil
  @size = 0
  @compressed_size = 0
  @crc = nil
  @is_dir = false
  @host_os = 0
  @mtime = nil
  @attributes = nil
  @method = 0
  @version = 0
  @flags = 0
  @volume_index = 0
  @split_before = false
  @split_after = false
  @encrypted = false
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def attributes
  @attributes
end

#compressed_sizeObject

Returns the value of attribute compressed_size.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def compressed_size
  @compressed_size
end

#crcObject

Returns the value of attribute crc.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def crc
  @crc
end

#encryptedObject

Returns the value of attribute encrypted.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def encrypted
  @encrypted
end

#flagsObject

Returns the value of attribute flags.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def flags
  @flags
end

#host_osObject

Returns the value of attribute host_os.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def host_os
  @host_os
end

#is_dirObject

Returns the value of attribute is_dir.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def is_dir
  @is_dir
end

#methodObject

Returns the value of attribute method.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def method
  @method
end

#mtimeObject

Returns the value of attribute mtime.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def mtime
  @mtime
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def name
  @name
end

#sizeObject

Returns the value of attribute size.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def size
  @size
end

#split_afterObject

Returns the value of attribute split_after.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def split_after
  @split_after
end

#split_beforeObject

Returns the value of attribute split_before.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def split_before
  @split_before
end

#versionObject

Returns the value of attribute version.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def version
  @version
end

#volume_indexObject

Returns the value of attribute volume_index.



10
11
12
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 10

def volume_index
  @volume_index
end

Instance Method Details

#directory?Boolean

Check if entry is a directory

Returns:

  • (Boolean)

    true if directory



37
38
39
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 37

def directory?
  @is_dir
end

#encrypted?Boolean

Check if entry is encrypted

Returns:

  • (Boolean)

    true if encrypted



51
52
53
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 51

def encrypted?
  @encrypted
end

#file?Boolean

Check if entry is a file

Returns:

  • (Boolean)

    true if regular file



44
45
46
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 44

def file?
  !@is_dir
end

#split?Boolean

Check if entry spans volumes

Returns:

  • (Boolean)

    true if split across volumes



58
59
60
# File 'lib/omnizip/formats/rar/models/rar_entry.rb', line 58

def split?
  @split_before || @split_after
end