Class: Rbzlib::Posf
Instance Attribute Summary
Attributes inherited from Bytef_str
#buffer, #offset
Instance Method Summary
collapse
Methods inherited from Bytef_str
#current, #initialize, #length
Instance Method Details
#+(inc) ⇒ Object
233
234
235
236
|
# File 'lib/pr/rbzlib.rb', line 233
def +(inc)
@offset += inc * 2
self
end
|
#-(dec) ⇒ Object
238
239
240
241
|
# File 'lib/pr/rbzlib.rb', line 238
def -(dec)
@offset -= dec * 2
self
end
|
#[](idx) ⇒ Object
243
244
245
|
# File 'lib/pr/rbzlib.rb', line 243
def [](idx)
@buffer[(idx * 2) + @offset, 2].unpack('v').first
end
|
#[]=(idx, val) ⇒ Object
247
248
249
|
# File 'lib/pr/rbzlib.rb', line 247
def []=(idx, val)
@buffer[(idx * 2) + @offset, 2] = [val].pack('v')
end
|
#get ⇒ Object
251
252
253
|
# File 'lib/pr/rbzlib.rb', line 251
def get()
@buffer[@offset, 2].unpack('v').first
end
|
#set(val) ⇒ Object
255
256
257
|
# File 'lib/pr/rbzlib.rb', line 255
def set(val)
@buffer[@offset, 2] = [val].pack('v')
end
|