Class: Watobo::NTLM::Int32LE
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#initialize(opt) ⇒ Int32LE
constructor
A new instance of Int32LE.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
Methods inherited from Field
Constructor Details
#initialize(opt) ⇒ Int32LE
Returns a new instance of Int32LE.
366 367 368 369 |
# File 'lib/watobo/utils/ntlm.rb', line 366 def initialize(opt) super(opt) @size = 4 end |
Instance Method Details
#parse(str, offset = 0) ⇒ Object
371 372 373 374 375 376 377 378 |
# File 'lib/watobo/utils/ntlm.rb', line 371 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 |
#serialize ⇒ Object
380 381 382 |
# File 'lib/watobo/utils/ntlm.rb', line 380 def serialize [@value].pack("V") if @active end |