Class: HttpServer::Request

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

Overview

Classes -------------------------------------------------

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.



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

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



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

def data
  @data
end

#headerObject (readonly)

Returns the value of attribute header



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

def header
  @header
end

#methodObject (readonly)

Returns the value of attribute method



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

def method
  @method
end

#pathObject (readonly)

Returns the value of attribute path



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

def path
  @path
end

#protoObject (readonly)

Returns the value of attribute proto



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

def proto
  @proto
end

Instance Method Details

#content_lengthObject



58
59
60
61
62
# File 'lib/xmlrpc/httpserver.rb', line 58

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