Class: Net::NTLM::SecurityBuffer
- Inherits:
-
Object
- Object
- Net::NTLM::SecurityBuffer
- Defined in:
- lib/net/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.
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
#active ⇒ Object
Returns the value of attribute active.
485 486 487 |
# File 'lib/net/ntlm.rb', line 485 def active @active end |
Instance Method Details
#data_size ⇒ Object
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 |
#serialize ⇒ Object
503 504 505 |
# File 'lib/net/ntlm.rb', line 503 def serialize super if @active end |
#value ⇒ Object
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 |