Class: Omnizip::Implementations::Base::LZMA2DecoderBase Abstract
- Inherits:
-
Object
- Object
- Omnizip::Implementations::Base::LZMA2DecoderBase
- Defined in:
- lib/omnizip/implementations/base/lzma2_decoder_base.rb
Overview
Instance Attribute Summary collapse
-
#dict_size ⇒ Object
readonly
Returns the value of attribute dict_size.
Instance Method Summary collapse
-
#decode(output = nil) ⇒ void
Decode LZMA2 compressed data.
-
#implementation_name ⇒ Symbol
Get the implementation identifier.
-
#initialize(input, options = {}) ⇒ LZMA2DecoderBase
constructor
Initialize the LZMA2 decoder.
Constructor Details
#initialize(input, options = {}) ⇒ LZMA2DecoderBase
Initialize the LZMA2 decoder.
42 43 44 45 46 |
# File 'lib/omnizip/implementations/base/lzma2_decoder_base.rb', line 42 def initialize(input, = {}) @input = input # Dictionary size will be read from LZMA2 property byte by subclasses @dict_size = .fetch(:dict_size, nil) end |
Instance Attribute Details
#dict_size ⇒ Object (readonly)
Returns the value of attribute dict_size.
35 36 37 |
# File 'lib/omnizip/implementations/base/lzma2_decoder_base.rb', line 35 def dict_size @dict_size end |
Instance Method Details
#decode(output = nil) ⇒ void
This method returns an undefined value.
Decode LZMA2 compressed data.
Subclasses must implement this method to provide the specific decoding logic for their implementation (XZ Utils, 7-Zip, etc.).
56 57 58 59 |
# File 'lib/omnizip/implementations/base/lzma2_decoder_base.rb', line 56 def decode(output = nil) raise NotImplementedError, "#{self.class} must implement #decode" end |
#implementation_name ⇒ Symbol
Get the implementation identifier.
Subclasses must implement this to return a symbol identifying their implementation (e.g., :xz_utils, :seven_zip).
68 69 70 71 |
# File 'lib/omnizip/implementations/base/lzma2_decoder_base.rb', line 68 def implementation_name raise NotImplementedError, "#{self.class} must implement #implementation_name" end |