Class: Rainbows::DevFdResponse::Body

Inherits:
Struct
  • Object
show all
Defined in:
lib/rainbows/dev_fd_response.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#orig_bodyObject

Returns the value of attribute orig_body

Returns:

  • (Object)

    the current value of orig_body



66
67
68
# File 'lib/rainbows/dev_fd_response.rb', line 66

def orig_body
  @orig_body
end

#to_ioObject

Returns the value of attribute to_io

Returns:

  • (Object)

    the current value of to_io



66
67
68
# File 'lib/rainbows/dev_fd_response.rb', line 66

def to_io
  @to_io
end

#to_pathObject Also known as: to_path_orig

Returns the value of attribute to_path

Returns:

  • (Object)

    the current value of to_path



66
67
68
# File 'lib/rainbows/dev_fd_response.rb', line 66

def to_path
  @to_path
end

Instance Method Details

#closeObject

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

#eachObject

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