Class: Rosendo::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/rosendo/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
# File 'lib/rosendo/request.rb', line 5

def initialize(io)
  @io = io
  @method, @url = @io.gets.match(%r{(GET|POST|PUT|DELETE)\s(.+)\sHTTP/1\.1})[1..2]
  @headers = read_headers
end

Instance Attribute Details

#headersObject (readonly) Also known as: env

Returns the value of attribute headers.



3
4
5
# File 'lib/rosendo/request.rb', line 3

def headers
  @headers
end

#methodObject (readonly)

Returns the value of attribute method.



3
4
5
# File 'lib/rosendo/request.rb', line 3

def method
  @method
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/rosendo/request.rb', line 3

def url
  @url
end

Instance Method Details

#paramsObject



11
12
13
# File 'lib/rosendo/request.rb', line 11

def params
  {}
end