Sha256: 246913ef8abaec30145d9e7f2325eafccf858f4c1a30c79ee63adc707b2a08fe

Contents?: true

Size: 447 Bytes

Versions: 3

Compression:

Stored size: 447 Bytes

Contents

module HttpResponseFactory

  def self.ok(body)
    response = Net::HTTPOK.new '1.1', '200', 'nil'
    response.body = body
    response.content_type = 'text/html'
    response.instance_variable_set '@read', true
    response
  end

  def self.not_found
    response = Net::HTTPNotFound.new '1.1', '404', 'nil'
    response.body = nil
    response.content_type = 'text/html'
    response.instance_variable_set '@read', true
    response
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
web_client-0.0.6 spec/http_response_factory.rb
web_client-0.0.5 spec/http_response_factory.rb
web_client-0.0.4 spec/http_response_factory.rb