Sha256: 10d2df19354bb1022938ed0c46b63c55732699de5b4ecde8c2dd5349a0e44c82

Contents?: true

Size: 491 Bytes

Versions: 11

Compression:

Stored size: 491 Bytes

Contents

module Spire
  class Response
    attr_accessor :status_code, :headers, :content

    def initialize(content='', content_type='text/html; charset=utf8', status=200)
      @content = content
      @headers = {'Content-Type' => content_type}
      @status_code = status
    end
    
    def manual_response(content, headers, status)
      @content = content
      @headers = headers
      @status_code = status
    end

    def to_rack
      [status_code, headers, [content]]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spire-0.4.6 lib/spire/http.rb
spire-0.4.5 lib/spire/http.rb
spire-0.4.4 lib/spire/http.rb
spire-0.4.3 lib/spire/http.rb
spire-0.4.2 lib/spire/http.rb
spire-0.4.1 lib/spire/http.rb
spire-0.4.0 lib/spire/http.rb
spire-0.3.3 lib/spire/http.rb
spire-0.3.2 lib/spire/http.rb
spire-0.3.0 lib/spire/http.rb
spire-0.2.4 lib/spire/http.rb