Class: Rainbows::DevFdResponse::Body
- Inherits:
-
Struct
- Object
- Struct
- Rainbows::DevFdResponse::Body
- Defined in:
- lib/rainbows/dev_fd_response.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#orig_body ⇒ Object
Returns the value of attribute orig_body.
-
#to_io ⇒ Object
Returns the value of attribute to_io.
-
#to_path ⇒ Object
(also: #to_path_orig)
Returns the value of attribute to_path.
Instance Method Summary collapse
-
#close ⇒ Object
called by the web server after #each.
-
#each ⇒ Object
called by the webserver or other middlewares if they can’t handle #to_path.
Instance Attribute Details
#orig_body ⇒ Object
Returns the value of attribute orig_body
66 67 68 |
# File 'lib/rainbows/dev_fd_response.rb', line 66 def orig_body @orig_body end |
#to_io ⇒ Object
Returns the value of attribute to_io
66 67 68 |
# File 'lib/rainbows/dev_fd_response.rb', line 66 def to_io @to_io end |
#to_path ⇒ Object Also known as: to_path_orig
Returns the value of attribute to_path
66 67 68 |
# File 'lib/rainbows/dev_fd_response.rb', line 66 def to_path @to_path end |
Instance Method Details
#close ⇒ Object
called by the web server after #each
80 81 82 83 84 |
# File 'lib/rainbows/dev_fd_response.rb', line 80 def close to_io.close unless to_io.closed? orig_body.close if orig_body.respond_to?(:close) # may not be an IO rescue IOError # could've been IO::new()'ed and closed end |
#each ⇒ Object
called by the webserver or other middlewares if they can’t handle #to_path
69 70 71 |
# File 'lib/rainbows/dev_fd_response.rb', line 69 def each to_io.each { |x| yield x } end |