Class: SevenZipRuby::EntryInfo
- Inherits:
-
Object
- Object
- SevenZipRuby::EntryInfo
- Defined in:
- lib/seven_zip_ruby/entry_info.rb
Instance Attribute Summary collapse
-
#atime ⇒ Object
readonly
Returns the value of attribute atime.
-
#attrib ⇒ Object
readonly
Returns the value of attribute attrib.
-
#crc ⇒ Object
(also: #crc32)
readonly
Returns the value of attribute crc.
-
#ctime ⇒ Object
readonly
Returns the value of attribute ctime.
-
#index ⇒ Object
(also: #to_i)
readonly
Returns the value of attribute index.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#mtime ⇒ Object
readonly
Returns the value of attribute mtime.
-
#pack_size ⇒ Object
readonly
Returns the value of attribute pack_size.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #anti? ⇒ Boolean
- #directory? ⇒ Boolean
- #encrypted? ⇒ Boolean
- #file? ⇒ Boolean
- #has_data? ⇒ Boolean
-
#initialize(index, path, method, dir, encrypted, anti, size, pack_size, ctime, atime, mtime, attrib, crc) ⇒ EntryInfo
constructor
A new instance of EntryInfo.
- #inspect ⇒ Object
Constructor Details
#initialize(index, path, method, dir, encrypted, anti, size, pack_size, ctime, atime, mtime, attrib, crc) ⇒ EntryInfo
Returns a new instance of EntryInfo.
5 6 7 8 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 5 def initialize(index, path, method, dir, encrypted, anti, size, pack_size, ctime, atime, mtime, attrib, crc) @index, @path, @method, @dir, @encrypted, @anti, @size, @pack_size, @ctime, @atime, @mtime, @attrib, @crc = index, Pathname(path.to_s.force_encoding(Encoding::UTF_8)).cleanpath.to_s, method, dir, encrypted, anti, size, pack_size, ctime, atime, mtime, attrib, crc end |
Instance Attribute Details
#atime ⇒ Object (readonly)
Returns the value of attribute atime.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def atime @atime end |
#attrib ⇒ Object (readonly)
Returns the value of attribute attrib.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def attrib @attrib end |
#crc ⇒ Object (readonly) Also known as: crc32
Returns the value of attribute crc.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def crc @crc end |
#ctime ⇒ Object (readonly)
Returns the value of attribute ctime.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def ctime @ctime end |
#index ⇒ Object (readonly) Also known as: to_i
Returns the value of attribute index.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def index @index end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def method @method end |
#mtime ⇒ Object (readonly)
Returns the value of attribute mtime.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def mtime @mtime end |
#pack_size ⇒ Object (readonly)
Returns the value of attribute pack_size.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def pack_size @pack_size end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def path @path end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
10 11 12 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 10 def size @size end |
Instance Method Details
#anti? ⇒ Boolean
26 27 28 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 26 def anti? return @anti end |
#directory? ⇒ Boolean
14 15 16 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 14 def directory? return @dir end |
#encrypted? ⇒ Boolean
22 23 24 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 22 def encrypted? return @encrypted end |
#file? ⇒ Boolean
18 19 20 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 18 def file? return !(@dir) end |
#has_data? ⇒ Boolean
30 31 32 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 30 def has_data? return !(@dir || @anti) end |
#inspect ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 34 def inspect if (@anti) type = "anti" elsif (@dir) type = "dir" else type = "file" end str = path.encode(Encoding::ASCII, invalid: :replace, undef: :replace, replace: "?") return "#<EntryInfo: #{index}, #{type}, #{str}>" end |