Class: Net::NTLM::Field

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

Overview

base classes for primitives

Direct Known Subclasses

Int16LE, Int32LE, Int64LE, String

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Field

Returns a new instance of Field.



9
10
11
12
13
# File 'lib/net/ntlm/field.rb', line 9

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

Instance Attribute Details

#activeObject

Returns the value of attribute active.



7
8
9
# File 'lib/net/ntlm/field.rb', line 7

def active
  @active
end

#valueObject

Returns the value of attribute value.



7
8
9
# File 'lib/net/ntlm/field.rb', line 7

def value
  @value
end

Instance Method Details

#parse(str, offset = 0) ⇒ Object

Parser function for field data Exists in this class to be overridden by child classes

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/net/ntlm/field.rb', line 27

def parse(str, offset=0)
  raise NotImplementedError
end

#serializeObject

Serializer function for field data Exists in this class to be overridden by child classes

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/net/ntlm/field.rb', line 21

def serialize
  raise NotImplementedError
end

#sizeObject



15
16
17
# File 'lib/net/ntlm/field.rb', line 15

def size
  @active ? @size : 0
end