Class: Webmachine::Adapters::Ring::RingRequest::Body
- Inherits:
-
Object
- Object
- Webmachine::Adapters::Ring::RingRequest::Body
- Defined in:
- lib/webmachine/adapters/ring.rb
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(body) ⇒ Body
constructor
A new instance of Body.
- #to_s ⇒ Object
Constructor Details
#initialize(body) ⇒ Body
Returns a new instance of Body.
129 130 131 |
# File 'lib/webmachine/adapters/ring.rb', line 129 def initialize(body) @body = body end |
Instance Method Details
#each ⇒ Object
142 143 144 145 146 147 148 149 |
# File 'lib/webmachine/adapters/ring.rb', line 142 def each if @value @value.each {|chunk| yield chunk } else @value = [] @body.each {|chunk| @value << chunk; yield chunk } end end |
#to_s ⇒ Object
133 134 135 136 137 138 139 140 |
# File 'lib/webmachine/adapters/ring.rb', line 133 def to_s if @value @value.join else @body.rewind @body.read end end |