Class: Zip::ExtraField::Unknown
- Inherits:
-
ExtraField::Generic
- Object
- ExtraField::Generic
- 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
:nodoc:.
- #merge(binstr, local: false) ⇒ Object
- #to_c_dir_bin ⇒ Object
- #to_local_bin ⇒ Object
Constructor Details
#initialize ⇒ Unknown
:nodoc:
8 9 10 11 |
# File 'lib/zip/extra_field/unknown.rb', line 8 def initialize @local_bin = +'' @cdir_bin = +'' end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 |
# File 'lib/zip/extra_field/unknown.rb', line 31 def ==(other) @local_bin == other.to_local_bin && @cdir_bin == other.to_c_dir_bin end |
#merge(binstr, local: false) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/zip/extra_field/unknown.rb', line 13 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
27 28 29 |
# File 'lib/zip/extra_field/unknown.rb', line 27 def to_c_dir_bin @cdir_bin end |
#to_local_bin ⇒ Object
23 24 25 |
# File 'lib/zip/extra_field/unknown.rb', line 23 def to_local_bin @local_bin end |