Class: Zip::ExtraField::Unknown
- Inherits:
-
Object
- Object
- Zip::ExtraField::Unknown
- Defined in:
- lib/zip/extra_field/unknown.rb
Overview
A class to hold unknown extra fields so that they are preserved.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize ⇒ Unknown
constructor
A new instance of Unknown.
- #merge(binstr, local: false) ⇒ Object
- #to_c_dir_bin ⇒ Object
- #to_local_bin ⇒ Object
Constructor Details
#initialize ⇒ Unknown
Returns a new instance of Unknown.
6 7 8 9 |
# File 'lib/zip/extra_field/unknown.rb', line 6 def initialize @local_bin = +'' @cdir_bin = +'' end |
Instance Method Details
#==(other) ⇒ Object
29 30 31 |
# File 'lib/zip/extra_field/unknown.rb', line 29 def ==(other) @local_bin == other.to_local_bin && @cdir_bin == other.to_c_dir_bin end |
#merge(binstr, local: false) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/zip/extra_field/unknown.rb', line 11 def merge(binstr, local: false) return if binstr.empty? if local @local_bin << binstr else @cdir_bin << binstr end end |
#to_c_dir_bin ⇒ Object
25 26 27 |
# File 'lib/zip/extra_field/unknown.rb', line 25 def to_c_dir_bin @cdir_bin end |
#to_local_bin ⇒ Object
21 22 23 |
# File 'lib/zip/extra_field/unknown.rb', line 21 def to_local_bin @local_bin end |