Class: Net::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.
544
545
546
547
548
549
|
# File 'lib/net/ntlm.rb', line 544
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.
543
544
545
|
# File 'lib/net/ntlm.rb', line 543
def active
@active
end
|
Instance Method Details
540
|
# File 'lib/net/ntlm.rb', line 540
int16LE :allocated, {:value => 0}
|
540
|
# File 'lib/net/ntlm.rb', line 540
int16LE :allocated, {:value => 0}
|
#data_size ⇒ Object
574
575
576
|
# File 'lib/net/ntlm.rb', line 574
def data_size
@active ? @value.size : 0
end
|
539
|
# File 'lib/net/ntlm.rb', line 539
int16LE :length, {:value => 0}
|
539
|
# File 'lib/net/ntlm.rb', line 539
int16LE :length, {:value => 0}
|
541
|
# File 'lib/net/ntlm.rb', line 541
int32LE :offset, {:value => 0}
|
541
|
# File 'lib/net/ntlm.rb', line 541
int32LE :offset, {:value => 0}
|
#parse(str, offset = 0) ⇒ Object
551
552
553
554
555
556
557
558
559
|
# File 'lib/net/ntlm.rb', line 551
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
561
562
563
|
# File 'lib/net/ntlm.rb', line 561
def serialize
super if @active
end
|
#value ⇒ Object
565
566
567
|
# File 'lib/net/ntlm.rb', line 565
def value
@value
end
|
#value=(val) ⇒ Object
569
570
571
572
|
# File 'lib/net/ntlm.rb', line 569
def value=(val)
@value = val
self.length = self.allocated = val.size
end
|