Class: Net::NTLM::SecurityBuffer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from FieldSet
#[], #[]=, #disable, #enable, #has_disabled_fields?, int16LE, int32LE, int64LE, names, opts, prototypes, security_buffer, #size, string, types
Constructor Details
Returns a new instance of SecurityBuffer.
12
13
14
15
16
17
|
# File 'lib/net/ntlm/security_buffer.rb', line 12
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.
11
12
13
|
# File 'lib/net/ntlm/security_buffer.rb', line 11
def active
@active
end
|
Instance Method Details
8
|
# File 'lib/net/ntlm/security_buffer.rb', line 8
int16LE :allocated, {:value => 0}
|
8
|
# File 'lib/net/ntlm/security_buffer.rb', line 8
int16LE :allocated, {:value => 0}
|
#data_size ⇒ Object
42
43
44
|
# File 'lib/net/ntlm/security_buffer.rb', line 42
def data_size
@active ? @value.size : 0
end
|
7
|
# File 'lib/net/ntlm/security_buffer.rb', line 7
int16LE :length, {:value => 0}
|
7
|
# File 'lib/net/ntlm/security_buffer.rb', line 7
int16LE :length, {:value => 0}
|
9
|
# File 'lib/net/ntlm/security_buffer.rb', line 9
int32LE :offset, {:value => 0}
|
9
|
# File 'lib/net/ntlm/security_buffer.rb', line 9
int32LE :offset, {:value => 0}
|
#parse(str, offset = 0) ⇒ Object
19
20
21
22
23
24
25
26
27
|
# File 'lib/net/ntlm/security_buffer.rb', line 19
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
29
30
31
|
# File 'lib/net/ntlm/security_buffer.rb', line 29
def serialize
super if @active
end
|
#value ⇒ Object
33
34
35
|
# File 'lib/net/ntlm/security_buffer.rb', line 33
def value
@value
end
|
#value=(val) ⇒ Object
37
38
39
40
|
# File 'lib/net/ntlm/security_buffer.rb', line 37
def value=(val)
@value = val
self.length = self.allocated = val.size
end
|