Class: Zip::Decompressor

Inherits:
Object
  • Object
show all
Defined in:
lib/zip/decompressor.rb

Overview

:nodoc:all

Direct Known Subclasses

Inflater, PassThruDecompressor

Constant Summary collapse

CHUNK_SIZE =
32_768

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_stream, decompressed_size = nil) ⇒ Decompressor

Returns a new instance of Decompressor.



21
22
23
24
25
26
# File 'lib/zip/decompressor.rb', line 21

def initialize(input_stream, decompressed_size = nil)
  super()

  @input_stream = input_stream
  @decompressed_size = decompressed_size
end

Instance Attribute Details

#decompressed_sizeObject (readonly)

Returns the value of attribute decompressed_size.



19
20
21
# File 'lib/zip/decompressor.rb', line 19

def decompressed_size
  @decompressed_size
end

#input_streamObject (readonly)

Returns the value of attribute input_stream.



19
20
21
# File 'lib/zip/decompressor.rb', line 19

def input_stream
  @input_stream
end

Class Method Details

.decompressor_classesObject



7
8
9
# File 'lib/zip/decompressor.rb', line 7

def self.decompressor_classes
  @decompressor_classes ||= {}
end

.find_by_compression_method(compression_method) ⇒ Object



15
16
17
# File 'lib/zip/decompressor.rb', line 15

def self.find_by_compression_method(compression_method)
  decompressor_classes[compression_method]
end

.register(compression_method, decompressor_class) ⇒ Object



11
12
13
# File 'lib/zip/decompressor.rb', line 11

def self.register(compression_method, decompressor_class)
  decompressor_classes[compression_method] = decompressor_class
end