Class: HttpServer::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/xmlrpc/httpserver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, method = nil, path = nil, proto = nil) ⇒ Request

Returns a new instance of Request.



46
47
48
49
# File 'lib/xmlrpc/httpserver.rb', line 46

def initialize(data, method=nil, path=nil, proto=nil)
  @header, @data = Table.new, data
  @method, @path, @proto = method, path, proto
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



44
45
46
# File 'lib/xmlrpc/httpserver.rb', line 44

def data
  @data
end

#headerObject (readonly)

Returns the value of attribute header.



44
45
46
# File 'lib/xmlrpc/httpserver.rb', line 44

def header
  @header
end

#methodObject (readonly)

Returns the value of attribute method.



44
45
46
# File 'lib/xmlrpc/httpserver.rb', line 44

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path.



44
45
46
# File 'lib/xmlrpc/httpserver.rb', line 44

def path
  @path
end

#protoObject (readonly)

Returns the value of attribute proto.



44
45
46
# File 'lib/xmlrpc/httpserver.rb', line 44

def proto
  @proto
end

Instance Method Details

#content_lengthObject



51
52
53
54
55
# File 'lib/xmlrpc/httpserver.rb', line 51

def content_length
  len = @header['Content-Length']
  return nil if len.nil?
  return len.to_i
end