Class: Webmachine::Adapters::Mongrel::RequestBody Private
- Inherits:
-
Object
- Object
- Webmachine::Adapters::Mongrel::RequestBody
- Defined in:
- lib/webmachine/adapters/mongrel.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Wraps a Mongrel request body so that it can behave like a String.
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
private
The request from Mongrel.
Instance Method Summary collapse
- #each {|chunk| ... } ⇒ Object private
-
#initialize(request) ⇒ RequestBody
constructor
private
A new instance of RequestBody.
-
#to_s ⇒ String
private
The request body as a string.
Constructor Details
#initialize(request) ⇒ RequestBody
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RequestBody.
108 109 110 |
# File 'lib/webmachine/adapters/mongrel.rb', line 108 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the request from Mongrel.
105 106 107 |
# File 'lib/webmachine/adapters/mongrel.rb', line 105 def request @request end |
Instance Method Details
#each {|chunk| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
120 121 122 |
# File 'lib/webmachine/adapters/mongrel.rb', line 120 def each(&block) request.body.each(&block) end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the request body as a string.
113 114 115 116 |
# File 'lib/webmachine/adapters/mongrel.rb', line 113 def to_s request.body.rewind request.body.read end |