Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
http-protocol / lib / http / protocol / response.rb
Size: Mime:
module HTTP
  module Protocol
    class Response
      include Message

      attr_reader :status_code
      attr_reader :reason_phrase

      def initialize(status_code, reason_phrase)
        @status_code = status_code
        @reason_phrase = reason_phrase
      end

      def headers
        @headers ||= Headers.build
      end

      def parse_header(name)
        headers.handlers[name].value
      end

      def status_line
        "HTTP/1.1 #{status_code} #{reason_phrase}"
      end
      alias_method :first_line, :status_line
    end
  end
end