Class: Watobo::NTLM::SecurityBuffer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from FieldSet
#[], #[]=, #disable, #enable, int16LE, int32LE, int64LE, names, opts, prototypes, security_buffer, #size, string, types
Constructor Details
Returns a new instance of SecurityBuffer.
550
551
552
553
554
555
|
# File 'lib/watobo/utils/ntlm.rb', line 550
def initialize(opts)
super()
@value = opts[:value]
@active = opts[:active].nil? ? true : opts[:active]
@size = 8
end
|
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
549
550
551
|
# File 'lib/watobo/utils/ntlm.rb', line 549
def active
@active
end
|
Instance Method Details
546
|
# File 'lib/watobo/utils/ntlm.rb', line 546
int16LE :allocated, {:value => 0}
|
546
|
# File 'lib/watobo/utils/ntlm.rb', line 546
int16LE :allocated, {:value => 0}
|
#data_size ⇒ Object
580
581
582
|
# File 'lib/watobo/utils/ntlm.rb', line 580
def data_size
@active ? @value.size : 0
end
|
545
|
# File 'lib/watobo/utils/ntlm.rb', line 545
int16LE :length, {:value => 0}
|
545
|
# File 'lib/watobo/utils/ntlm.rb', line 545
int16LE :length, {:value => 0}
|
547
|
# File 'lib/watobo/utils/ntlm.rb', line 547
int32LE :offset, {:value => 0}
|
547
|
# File 'lib/watobo/utils/ntlm.rb', line 547
int32LE :offset, {:value => 0}
|
#parse(str, offset = 0) ⇒ Object
557
558
559
560
561
562
563
564
565
|
# File 'lib/watobo/utils/ntlm.rb', line 557
def parse(str, offset=0)
if @active and str.size >= offset + @size
super(str, offset)
@value = str[self.offset, self.length]
@size
else
0
end
end
|
#serialize ⇒ Object
567
568
569
|
# File 'lib/watobo/utils/ntlm.rb', line 567
def serialize
super if @active
end
|
#value ⇒ Object
571
572
573
|
# File 'lib/watobo/utils/ntlm.rb', line 571
def value
@value
end
|
#value=(val) ⇒ Object
575
576
577
578
|
# File 'lib/watobo/utils/ntlm.rb', line 575
def value=(val)
@value = val
self.length = self.allocated = val.size
end
|