Sha256: a6bb92f22e82ab90cd7b06db594ea21c261f9f0de31307919ee3c5a3341ba404

Contents?: true

Size: 785 Bytes

Versions: 1

Compression:

Stored size: 785 Bytes

Contents

##
# This class is used to be sandbox of requests processing.
# @attr [Fixnum] code HTTP response code
# @attr [Hash] header HTTP response header
# @attr [Object] body HTTP response body. String could is accepted by default, but could leave for further process with +Midori::Midlleware+
# @attr [Midori::Request] request HTTP request
class Midori::CleanRoom
  attr_accessor :code, :header, :body, :request
  # @param [Midori::Request] request HTTP request
  def initialize(request)
    @status = 200
    @header = Midori::Const::DEFAULT_HEADER.clone
    @body = ''
    @request = request
  end

  # Generate response from variables inside +Midori::CleanRoom+
  # @return [Midori::Response] midori response
  def raw_response
    Midori::Response.new(@status, @header, @body)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
em-midori-0.1.1 lib/em-midori/clean_room.rb