Class: FCGI::BeginRequestRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/cgialt/fcgi/core.rb

Constant Summary collapse

BODY_FORMAT =

uint16_t role; (big endian) uint8_t flags; uint8_t reserved;

'nCC5'

Constants inherited from Record

Record::HEADER_FORMAT, Record::HEADER_LENGTH, Record::RECORD_CLASS

Instance Attribute Summary collapse

Attributes inherited from Record

#request_id, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

class_for, #management_record?, parse_header, #serialize, #version

Constructor Details

#initialize(id, role, flags) ⇒ BeginRequestRecord

Returns a new instance of BeginRequestRecord.



359
360
361
362
363
# File 'lib/cgialt/fcgi/core.rb', line 359

def initialize(id, role, flags)
  super FCGI_BEGIN_REQUEST, id
  @role = role
  @flags = flags
end

Instance Attribute Details

#flagsObject (readonly)

Returns the value of attribute flags.



366
367
368
# File 'lib/cgialt/fcgi/core.rb', line 366

def flags
  @flags
end

#roleObject (readonly)

Returns the value of attribute role.



365
366
367
# File 'lib/cgialt/fcgi/core.rb', line 365

def role
  @role
end

Class Method Details

.parse(id, body) ⇒ Object



354
355
356
357
# File 'lib/cgialt/fcgi/core.rb', line 354

def BeginRequestRecord.parse(id, body)
  role, flags, *reserved = *body.unpack(BODY_FORMAT)
  new(id, role, flags)
end

Instance Method Details

#make_bodyObject



368
369
370
# File 'lib/cgialt/fcgi/core.rb', line 368

def make_body
  [@role, @flags, 0, 0, 0, 0, 0].pack(BODY_FORMAT)
end