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.
541
542
543
544
545
546
|
# File 'lib/watobo/utils/ntlm.rb', line 541
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.
540
541
542
|
# File 'lib/watobo/utils/ntlm.rb', line 540
def active
@active
end
|
Instance Method Details
537
|
# File 'lib/watobo/utils/ntlm.rb', line 537
int16LE :allocated, {:value => 0}
|
537
|
# File 'lib/watobo/utils/ntlm.rb', line 537
int16LE :allocated, {:value => 0}
|
#data_size ⇒ Object
571
572
573
|
# File 'lib/watobo/utils/ntlm.rb', line 571
def data_size
@active ? @value.size : 0
end
|
536
|
# File 'lib/watobo/utils/ntlm.rb', line 536
int16LE :length, {:value => 0}
|
536
|
# File 'lib/watobo/utils/ntlm.rb', line 536
int16LE :length, {:value => 0}
|
538
|
# File 'lib/watobo/utils/ntlm.rb', line 538
int32LE :offset, {:value => 0}
|
538
|
# File 'lib/watobo/utils/ntlm.rb', line 538
int32LE :offset, {:value => 0}
|
#parse(str, offset = 0) ⇒ Object
548
549
550
551
552
553
554
555
556
|
# File 'lib/watobo/utils/ntlm.rb', line 548
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
558
559
560
|
# File 'lib/watobo/utils/ntlm.rb', line 558
def serialize
super if @active
end
|
#value ⇒ Object
562
563
564
|
# File 'lib/watobo/utils/ntlm.rb', line 562
def value
@value
end
|
#value=(val) ⇒ Object
566
567
568
569
|
# File 'lib/watobo/utils/ntlm.rb', line 566
def value=(val)
@value = val
self.length = self.allocated = val.size
end
|