Sha256: a32f845ca9af2e09cce2c8f8e7e0095758c6bde8a7be2467d06d630636161e91

Contents?: true

Size: 824 Bytes

Versions: 11

Compression:

Stored size: 824 Bytes

Contents

##
# This class is used to be sandbox of requests processing.
# @attr [Integer] status 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::Middleware+
# @attr [Midori::Request] request HTTP request
class Midori::CleanRoom
  attr_accessor :status, :header, :body, :request

  # Init a Cleanroom for running
  # @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

11 entries across 11 versions & 1 rubygems

Version Path
em-midori-0.2.4 lib/midori/clean_room.rb
em-midori-0.2.3 lib/midori/clean_room.rb
em-midori-0.2.2 lib/midori/clean_room.rb
em-midori-0.2.1 lib/midori/clean_room.rb
em-midori-0.2.0 lib/midori/clean_room.rb
em-midori-0.1.12 lib/midori/clean_room.rb
em-midori-0.1.11 lib/midori/clean_room.rb
em-midori-0.1.10 lib/midori/clean_room.rb
em-midori-0.1.9 lib/midori/clean_room.rb
em-midori-0.1.8 lib/midori/clean_room.rb
em-midori-0.1.7.1 lib/midori/clean_room.rb