Class: Lz4rip::Dictionary
- Inherits:
-
Data
- Object
- Data
- Lz4rip::Dictionary
- Defined in:
- lib/lz4rip/dictionary.rb
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(bytes:, id: Digest::SHA256.digest(bytes).byteslice(0, 4).unpack1("V")) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #size ⇒ Object
Constructor Details
#initialize(bytes:, id: Digest::SHA256.digest(bytes).byteslice(0, 4).unpack1("V")) ⇒ Dictionary
Returns a new instance of Dictionary.
7 8 9 |
# File 'lib/lz4rip/dictionary.rb', line 7 def initialize(bytes:, id: Digest::SHA256.digest(bytes).byteslice(0, 4).unpack1("V")) super(bytes: bytes.b.freeze, id: id) end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes
6 7 8 |
# File 'lib/lz4rip/dictionary.rb', line 6 def bytes @bytes end |
#id ⇒ Object (readonly)
Returns the value of attribute id
6 7 8 |
# File 'lib/lz4rip/dictionary.rb', line 6 def id @id end |
Instance Method Details
#size ⇒ Object
12 13 14 |
# File 'lib/lz4rip/dictionary.rb', line 12 def size bytes.bytesize end |