Sha256: 94a70e85765eb54940edb2fa0424d64a61c5ed61af82558787e53ea7ff2c8e16

Contents?: true

Size: 846 Bytes

Versions: 21

Compression:

Stored size: 846 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: @status, header: @header, body: @body)
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
midori.rb-0.9.0 lib/midori/clean_room.rb
midori.rb-0.8.0 lib/midori/clean_room.rb
midori.rb-0.7.1 lib/midori/clean_room.rb
midori.rb-0.7.0 lib/midori/clean_room.rb
midori.rb-0.6.0 lib/midori/clean_room.rb
midori.rb-0.5.4 lib/midori/clean_room.rb
midori.rb-0.5.3.1 lib/midori/clean_room.rb
midori.rb-0.5.3 lib/midori/clean_room.rb
midori.rb-0.5.2 lib/midori/clean_room.rb
midori.rb-0.5.1 lib/midori/clean_room.rb
midori.rb-0.5.0 lib/midori/clean_room.rb
midori.rb-0.4.4.1 lib/midori/clean_room.rb
midori.rb-0.4.4 lib/midori/clean_room.rb
midori.rb-0.4.3 lib/midori/clean_room.rb
em-midori-0.4.3 lib/midori/clean_room.rb
em-midori-0.4.2.1 lib/midori/clean_room.rb
em-midori-0.4.2 lib/midori/clean_room.rb
em-midori-0.4.1.1 lib/midori/clean_room.rb
em-midori-0.4.1 lib/midori/clean_room.rb
em-midori-0.4.0 lib/midori/clean_room.rb