Class: Net::NTLM::String
- Defined in:
- lib/watobo/external/ntlm/ntlm.rb
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#initialize(opts) ⇒ String
constructor
A new instance of String.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
- #value=(val) ⇒ Object
Methods inherited from Field
Constructor Details
#initialize(opts) ⇒ String
Returns a new instance of String.
292 293 294 295 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 292 def initialize(opts) super(opts) @size = opts[:size] end |
Instance Method Details
#parse(str, offset = 0) ⇒ Object
297 298 299 300 301 302 303 304 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 297 def parse(str, offset=0) if @active and str.size >= offset + @size @value = str[offset, @size] @size else 0 end end |
#serialize ⇒ Object
306 307 308 309 310 311 312 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 306 def serialize if @active @value else "" end end |
#value=(val) ⇒ Object
314 315 316 317 318 |
# File 'lib/watobo/external/ntlm/ntlm.rb', line 314 def value=(val) @value = val @size = @value.nil? ? 0 : @value.size @active = (@size > 0) end |