Class: PHPHandler::Events
- Inherits:
-
Struct
- Object
- Struct
- PHPHandler::Events
- Defined in:
- lib/phuby/rails.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
Returns the value of attribute code.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
4 5 6 |
# File 'lib/phuby/rails.rb', line 4 def body @body end |
#code ⇒ Object
Returns the value of attribute code
4 5 6 |
# File 'lib/phuby/rails.rb', line 4 def code @code end |
#headers ⇒ Object
Returns the value of attribute headers
4 5 6 |
# File 'lib/phuby/rails.rb', line 4 def headers @headers end |
Instance Method Details
#header(value, op) ⇒ Object
8 9 10 11 12 |
# File 'lib/phuby/rails.rb', line 8 def header value, op k, v = value.split(': ', 2) self.code = 302 if k == 'Location' headers[k] = [headers[k], Rack::Utils.unescape(v)].compact.join "\n" end |
#send_headers(response_code) ⇒ Object
6 |
# File 'lib/phuby/rails.rb', line 6 def send_headers response_code; end |
#write(string) ⇒ Object
5 |
# File 'lib/phuby/rails.rb', line 5 def write string; body << string; end |