Class: Mxrb::RubyApp::RackAdapter::Response
- Inherits:
-
Object
- Object
- Mxrb::RubyApp::RackAdapter::Response
- Defined in:
- lib/mxrb/ruby_app.rb
Overview
Minimal mutable response consumed by Server#dispatch.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, value) ⇒ Object
-
#initialize ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize ⇒ Response
Returns a new instance of Response.
1222 1223 1224 1225 1226 |
# File 'lib/mxrb/ruby_app.rb', line 1222 def initialize @status = 200 @body = '' @headers = {} end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
1219 1220 1221 |
# File 'lib/mxrb/ruby_app.rb', line 1219 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
1220 1221 1222 |
# File 'lib/mxrb/ruby_app.rb', line 1220 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
1219 1220 1221 |
# File 'lib/mxrb/ruby_app.rb', line 1219 def status @status end |
Instance Method Details
#[](name) ⇒ Object
1228 |
# File 'lib/mxrb/ruby_app.rb', line 1228 def [](name) = headers[name] |
#[]=(name, value) ⇒ Object
1230 1231 1232 |
# File 'lib/mxrb/ruby_app.rb', line 1230 def []=(name, value) headers[name] = value end |