Class: Pack::Delta::Copy
- Inherits:
-
Struct
- Object
- Struct
- Pack::Delta::Copy
- Defined in:
- lib/pack/delta.rb
Instance Attribute Summary collapse
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#size ⇒ Object
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#offset ⇒ Object
Returns the value of attribute offset
9 10 11 |
# File 'lib/pack/delta.rb', line 9 def offset @offset end |
#size ⇒ Object
Returns the value of attribute size
9 10 11 |
# File 'lib/pack/delta.rb', line 9 def size @size end |
Class Method Details
.parse(input, byte) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pack/delta.rb', line 10 def self.parse(input, byte) value = Numbers::PackedInt56LE.read(input, byte) offset = value & 0xffffffff size = value >> 32 Copy.new(offset, size) end |
Instance Method Details
#to_s ⇒ Object
18 19 20 21 22 |
# File 'lib/pack/delta.rb', line 18 def to_s bytes = Numbers::PackedInt56LE.write((size << 32) | offset) bytes[0] |= 0x80 bytes.pack("C*") end |