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
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, 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)
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
25 26 27 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 25 def anti? return @anti end |
#directory? ⇒ Boolean
13 14 15 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 13 def directory? return @dir end |
#encrypted? ⇒ Boolean
21 22 23 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 21 def encrypted? return @encrypted end |
#file? ⇒ Boolean
17 18 19 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 17 def file? return !(@dir) end |
#has_data? ⇒ Boolean
29 30 31 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 29 def has_data? return !(@dir || @anti) end |
#inspect ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/seven_zip_ruby/entry_info.rb', line 33 def inspect if (@anti) type = "anti" elsif (@dir) type = "dir" else type = "file" end str = path.to_s.encode(Encoding::ASCII, invalid: :replace, undef: :replace, replace: "?") return "#<EntryInfo: #{index}, #{type}, #{str}>" end |