Class: Zip::ExtraField::Unknown

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

Constructor Details

#initializeUnknown

:nodoc:



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_binObject



25
26
27
# File 'lib/zip/extra_field/unknown.rb', line 25

def to_c_dir_bin
  @cdir_bin
end

#to_local_binObject



21
22
23
# File 'lib/zip/extra_field/unknown.rb', line 21

def to_local_bin
  @local_bin
end