Class: Lz4rip::FrameCodec

Inherits:
Object
  • Object
show all
Defined in:
lib/lz4rip/frame_codec.rb

Class Method Summary collapse

Class Method Details

.new(dict: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/lz4rip/frame_codec.rb', line 7

def self.new(dict: nil)
  case dict
  when nil
    _native_new(nil, 0)
  when Dictionary
    _native_new(dict.bytes, dict.id)
  when String
    _native_new(dict, Dictionary.new(bytes: dict).id)
  else
    raise TypeError, "expected Lz4rip::Dictionary, String, or nil; got #{dict.class}"
  end
end