Module: ShamRack::NetHttp::Extensions
- Defined in:
- lib/sham_rack/net_http.rb
Instance Attribute Summary collapse
-
#rack_app ⇒ Object
Returns the value of attribute rack_app.
Instance Method Summary collapse
Instance Attribute Details
#rack_app ⇒ Object
Returns the value of attribute rack_app.
26 27 28 |
# File 'lib/sham_rack/net_http.rb', line 26 def rack_app @rack_app end |
Instance Method Details
#request(req, body = nil) {|response| ... } ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sham_rack/net_http.rb', line 36 def request(req, body = nil) env = default_env env.merge!(path_env(req.path)) env.merge!(method_env(req)) env.merge!(header_env(req)) env.merge!(io_env(req, body)) response = build_response(@rack_app.call(env)) yield response if block_given? return response end |
#start ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/sham_rack/net_http.rb', line 28 def start if block_given? yield self else self end end |