Class: Net::NTLM::FieldSet

### Home Classes Methods

### In Files

- lib/net/ntlm.rb
- lib/net/ntlm_http.rb

### Parent

Object

### Methods

- ::define
- ::int16LE
- ::int32LE
- ::int64LE
- ::names
- ::new
- ::opts
- ::prototypes
- ::security_buffer
- ::string
- ::types
- #[]
- #[]=
- #disable
- #enable
- #parse
- #serialize
- #size

### Files

- README

### Class/Module Index

Quicksearch

- Net
- Net::HTTP
- Net::HTTPHeader
- Net::HTTPRequest
- Net::NTLM
- Net::NTLM::Field
- Net::NTLM::FieldSet
- Net::NTLM::Int16LE
- Net::NTLM::Int32LE
- Net::NTLM::Int64LE
- Net::NTLM::Message
- Net::NTLM::Message::Type1
- Net::NTLM::Message::Type2
- Net::NTLM::Message::Type3
- Net::NTLM::SecurityBuffer
- Net::NTLM::String

No matching classes.

# Net::NTLM::FieldSet

base class of data structure

base class of data structure

### Public Class Methods

define(&block) click to toggle source

    # File lib/net/ntlm.rb, line 362
    def define(&block)
      c = Class.new(self)
      def c.inherited(subclass)
        proto = @proto
        subclass.instance_eval {
          @proto = proto
        }
      end
      c.module_eval(&block)
      c
    end

int16LE(name, opts) click to toggle source

    # File lib/net/ntlm.rb, line 378
    def int16LE(name, opts)
      add_field(name, Int16LE, opts)
    end

int32LE(name, opts) click to toggle source

    # File lib/net/ntlm.rb, line 382
    def int32LE(name, opts)
      add_field(name, Int32LE, opts)
    end

int64LE(name, opts) click to toggle source

    # File lib/net/ntlm.rb, line 386
    def int64LE(name, opts)
      add_field(name, Int64LE, opts)
    end

names() click to toggle source

    # File lib/net/ntlm.rb, line 398
    def names
      @proto.map{|n, t, o| n}
    end

new() click to toggle source

    # File lib/net/ntlm.rb, line 430
    def initialize
      @alist = self.class.prototypes.map{ |n, t, o| [n, t.new(o)] }
    end

opts() click to toggle source

    # File lib/net/ntlm.rb, line 406
    def opts
      @proto.map{|n, t, o| o}
    end

prototypes() click to toggle source

    # File lib/net/ntlm.rb, line 394
    def prototypes
      @proto
    end

security_buffer(name, opts) click to toggle source

    # File lib/net/ntlm.rb, line 390
    def security_buffer(name, opts)
      add_field(name, SecurityBuffer, opts)
    end

string(name, opts) click to toggle source

    # File lib/net/ntlm.rb, line 374
    def string(name, opts)
      add_field(name, String, opts)
    end

types() click to toggle source

    # File lib/net/ntlm.rb, line 402
    def types
      @proto.map{|n, t, o| t}
    end

### Public Instance Methods

[](name) click to toggle source

    # File lib/net/ntlm.rb, line 446
    def [](name)
      a = @alist.assoc(name.to_s.intern)
      raise ArgumentError, "no such field: #{name}" unless a
      a[1]
    end

[]=(name, val) click to toggle source

    # File lib/net/ntlm.rb, line 452
    def []=(name, val)
      a = @alist.assoc(name.to_s.intern)
      raise ArgumentError, "no such field: #{name}" unless a
      a[1] = val
    end

disable(name) click to toggle source

    # File lib/net/ntlm.rb, line 462
    def disable(name)
      self[name].active = false
    end

enable(name) click to toggle source

    # File lib/net/ntlm.rb, line 458
    def enable(name)
      self[name].active = true
    end

parse(str, offset=0) click to toggle source

    # File lib/net/ntlm.rb, line 438
    def parse(str, offset=0)
      @alist.inject(offset){|cur, a|  cur += a[1].parse(str, cur)}
    end

serialize() click to toggle source

    # File lib/net/ntlm.rb, line 434
    def serialize
      @alist.map{|n, f| f.serialize }.join
    end

size() click to toggle source

    # File lib/net/ntlm.rb, line 442
    def size
      @alist.inject(0){|sum, a| sum += a[1].size}
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.