Class: Net::NTLM::Int32LE

Inherits:
Field
  • Object
show all
Defined in:
lib/watobo/external/ntlm/ntlm.rb

Instance Attribute Summary

Attributes inherited from Field

#active, #value

Instance Method Summary collapse

Methods inherited from Field

#size

Constructor Details

#initialize(opt) ⇒ Int32LE

Returns a new instance of Int32LE.



342
343
344
345
# File 'lib/watobo/external/ntlm/ntlm.rb', line 342

def initialize(opt)
  super(opt)
  @size = 4
end

Instance Method Details

#parse(str, offset = 0) ⇒ Object



347
348
349
350
351
352
353
354
# File 'lib/watobo/external/ntlm/ntlm.rb', line 347

def parse(str, offset=0)
  if @active and str.size >= offset + @size
    @value = str.slice(offset, @size).unpack("V")[0]
    @size
  else
    0
  end
end

#serializeObject



356
357
358
# File 'lib/watobo/external/ntlm/ntlm.rb', line 356

def serialize
  [@value].pack("V") if @active
end