Class: Net::NTLM::SecurityBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/net/ntlm.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ SecurityBuffer

Returns a new instance of SecurityBuffer.



486
487
488
489
490
491
# File 'lib/net/ntlm.rb', line 486

def initialize(opts)
  super()
  @value  = opts[:value]
  @active = opts[:active].nil? ? true : opts[:active]
  @size = 8
end

Instance Attribute Details

#activeObject

Returns the value of attribute active.



485
486
487
# File 'lib/net/ntlm.rb', line 485

def active
  @active
end

Instance Method Details

#data_sizeObject



516
517
518
# File 'lib/net/ntlm.rb', line 516

def data_size
  @active ? @value.size : 0
end

#parse(str, offset = 0) ⇒ Object



493
494
495
496
497
498
499
500
501
# File 'lib/net/ntlm.rb', line 493

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

#serializeObject



503
504
505
# File 'lib/net/ntlm.rb', line 503

def serialize
  super if @active
end

#valueObject



507
508
509
# File 'lib/net/ntlm.rb', line 507

def value
  @value
end

#value=(val) ⇒ Object



511
512
513
514
# File 'lib/net/ntlm.rb', line 511

def value=(val)
  @value = val
  self.length = self.allocated = val.size
end