Class: FCGI::ValuesRecord

### Home Classes Methods

### In Files

- lib/fcgi.rb

### Parent

FCGI::Record

### Methods

- ::new
- ::parse
- ::parse_values
- ::read_length
- ::read_pair

### Class/Module Index

Quicksearch

- FCGI
- FCGI::AbortRequestRecord
- FCGI::BeginRequestRecord
- FCGI::DataRecord
- FCGI::EndRequestRecord
- FCGI::FastCGISocket
- FCGI::GenericDataRecord
- FCGI::GetValuesRecord
- FCGI::ParamsRecord
- FCGI::Record
- FCGI::RecordBuffer
- FCGI::Request
- FCGI::Server
- FCGI::StdinDataRecord
- FCGI::StdoutDataRecord
- FCGI::UnknownTypeRecord
- FCGI::ValuesRecord

No matching classes.

# FCGI::ValuesRecord

### Attributes

values[R]

### Public Class Methods

new(type, id, values) click to toggle source

    # File lib/fcgi.rb, line 460
    def initialize(type, id, values)
      super type, id
      @values = values
    end

parse(id, body) click to toggle source

    # File lib/fcgi.rb, line 434
    def self::parse(id, body)
      new(id, parse_values(body))
    end

parse_values(buf) click to toggle source

    # File lib/fcgi.rb, line 438
    def self::parse_values(buf)
      result = {}
      until buf.empty?
        name, value = *read_pair(buf)
        result[name] = value
      end
      result
    end

read_length(buf) click to toggle source

    # File lib/fcgi.rb, line 453
    def self::read_length(buf)
      if buf[0] >> 7 == 0
      then buf.slice!(0,1)[0]
      else buf.slice!(0,4).unpack('N')[0] & ((1<<31) - 1)
      end
    end

read_pair(buf) click to toggle source

    # File lib/fcgi.rb, line 447
    def self::read_pair(buf)
      nlen = read_length(buf)
      vlen = read_length(buf)
      return buf.slice!(0, nlen), buf.slice!(0, vlen)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.