Class: Archive::Zip::Codec::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/archive/zip/codec/store.rb

Overview

Archive::Zip::Codec::Store is a handle for the store-unstore (no compression) codec.

Defined Under Namespace

Classes: Compress, Decompress

Constant Summary collapse

ID =

The numeric identifier assigned to this compresion codec by the ZIP specification.

0

Instance Method Summary collapse

Constructor Details

#initialize(general_purpose_flags = 0) ⇒ Store

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

Creates a new instance of this class. general_purpose_flags is not used.



247
248
# File 'lib/archive/zip/codec/store.rb', line 247

def initialize(general_purpose_flags = 0)
end

Instance Method Details

#compression_methodObject

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

Returns an integer used to flag that this compression codec is used for a particular ZIP archive entry.



283
284
285
# File 'lib/archive/zip/codec/store.rb', line 283

def compression_method
  ID
end

#compressor(io, &b) ⇒ Object

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

A convenience method for creating an Archive::Zip::Codec::Store::Compress object using that class’ open method.



255
256
257
# File 'lib/archive/zip/codec/store.rb', line 255

def compressor(io, &b)
  Compress.open(io, &b)
end

#decompressor(io, &b) ⇒ Object

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

A convenience method for creating an Archive::Zip::Codec::Store::Decompress object using that class’ open method.



265
266
267
# File 'lib/archive/zip/codec/store.rb', line 265

def decompressor(io, &b)
  Decompress.open(io, &b)
end

#general_purpose_flagsObject

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

Returns 0 since this compression codec does not make use of general purpose flags of ZIP archive entries.



292
293
294
# File 'lib/archive/zip/codec/store.rb', line 292

def general_purpose_flags
  0
end

#version_needed_to_extractObject

This method signature is part of the interface contract expected by Archive::Zip::Entry for compression codec objects.

Returns an integer which indicates the version of the official ZIP specification which introduced support for this compression codec.



274
275
276
# File 'lib/archive/zip/codec/store.rb', line 274

def version_needed_to_extract
  0x000a
end