Class: Rosendo::Request
- Inherits:
-
Object
- Object
- Rosendo::Request
- Defined in:
- lib/rosendo/request.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
(also: #env)
readonly
Returns the value of attribute headers.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(io) ⇒ Request
constructor
A new instance of Request.
- #params ⇒ Object
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
#headers ⇒ Object (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 |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/rosendo/request.rb', line 3 def method @method end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/rosendo/request.rb', line 3 def url @url end |
Instance Method Details
#params ⇒ Object
11 12 13 |
# File 'lib/rosendo/request.rb', line 11 def params {} end |