Class: Net::NTLM::SecurityBuffer
- Inherits:
-
Object
- Object
- Net::NTLM::SecurityBuffer
- Defined in:
- lib/watobo/external/ntlm/ntlm.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
Instance Method Summary collapse
- #data_size ⇒ Object
-
#initialize(opts) ⇒ SecurityBuffer
constructor
A new instance of SecurityBuffer.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
- #value ⇒ Object
- #value=(val) ⇒ Object
Constructor Details
#initialize(opts) ⇒ SecurityBuffer
Returns a new instance of SecurityBuffer.
509 510 511 512 513 514 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 509 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.
508 509 510 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 508 def active @active end |
Instance Method Details
#data_size ⇒ Object
539 540 541 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 539 def data_size @active ? @value.size : 0 end |
#parse(str, offset = 0) ⇒ Object
516 517 518 519 520 521 522 523 524 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 516 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
526 527 528 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 526 def serialize super if @active end |
#value ⇒ Object
530 531 532 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 530 def value @value end |
#value=(val) ⇒ Object
534 535 536 537 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 534 def value=(val) @value = val self.length = self.allocated = val.size end |