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.



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

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.



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

def decompressed_size
  @decompressed_size
end

#input_streamObject (readonly)

Returns the value of attribute input_stream.



17
18
19
# File 'lib/zip/decompressor.rb', line 17

def input_stream
  @input_stream
end

Class Method Details

.decompressor_classesObject



5
6
7
# File 'lib/zip/decompressor.rb', line 5

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

.find_by_compression_method(compression_method) ⇒ Object



13
14
15
# File 'lib/zip/decompressor.rb', line 13

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

.register(compression_method, decompressor_class) ⇒ Object



9
10
11
# File 'lib/zip/decompressor.rb', line 9

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