Class: Zip::ExtraField::Unknown

Inherits:
Generic
  • Object
show all
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

Methods inherited from Generic

#initial_parse, name, register_map, #suppress?

Constructor Details

#initializeUnknown

: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_binObject



27
28
29
# File 'lib/zip/extra_field/unknown.rb', line 27

def to_c_dir_bin
  @cdir_bin
end

#to_local_binObject



23
24
25
# File 'lib/zip/extra_field/unknown.rb', line 23

def to_local_bin
  @local_bin
end