Class: Phuby::PHPHandler::Events
- Defined in:
- lib/phuby/php_handler.rb
Instance Method Summary collapse
- #header(value, op) ⇒ Object
-
#initialize(req, res) ⇒ Events
constructor
A new instance of Events.
- #send_headers(response_code) ⇒ Object
- #write(string) ⇒ Object
Constructor Details
#initialize(req, res) ⇒ Events
Returns a new instance of Events.
9 10 11 12 13 |
# File 'lib/phuby/php_handler.rb', line 9 def initialize req, res super() @req = req @res = res end |
Instance Method Details
#header(value, op) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/phuby/php_handler.rb', line 15 def header value, op k, v = *value.split(':', 2) if k.downcase == 'set-cookie' @res. << v.strip else @res[k] = v.strip end end |
#send_headers(response_code) ⇒ Object
29 30 |
# File 'lib/phuby/php_handler.rb', line 29 def send_headers response_code end |
#write(string) ⇒ Object
24 25 26 27 |
# File 'lib/phuby/php_handler.rb', line 24 def write string @res.body ||= '' @res.body << string end |