Class: Net::NTLM::Field
- Inherits:
-
Object
- Object
- Net::NTLM::Field
- Defined in:
- lib/net/ntlm/field.rb
Overview
base classes for primitives
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Field
constructor
A new instance of Field.
-
#parse(str, offset = 0) ⇒ Object
Parser function for field data Exists in this class to be overridden by child classes.
-
#serialize ⇒ Object
Serializer function for field data Exists in this class to be overridden by child classes.
- #size ⇒ Object
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
#active ⇒ Object
Returns the value of attribute active.
7 8 9 |
# File 'lib/net/ntlm/field.rb', line 7 def active @active end |
#value ⇒ Object
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
27 28 29 |
# File 'lib/net/ntlm/field.rb', line 27 def parse(str, offset=0) raise NotImplementedError end |
#serialize ⇒ Object
Serializer function for field data Exists in this class to be overridden by child classes
21 22 23 |
# File 'lib/net/ntlm/field.rb', line 21 def serialize raise NotImplementedError end |
#size ⇒ Object
15 16 17 |
# File 'lib/net/ntlm/field.rb', line 15 def size @active ? @size : 0 end |