Class: Mxrb::RubyApp::RackAdapter::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/mxrb/ruby_app.rb

Overview

Minimal mutable response consumed by Server#dispatch.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponse

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

#bodyObject

Returns the value of attribute body.



1219
1220
1221
# File 'lib/mxrb/ruby_app.rb', line 1219

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



1220
1221
1222
# File 'lib/mxrb/ruby_app.rb', line 1220

def headers
  @headers
end

#statusObject

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