Sha256: aef0fc9ba0d1f4cf7890bb6b96cd69aa652b47d2760e0441d348e64e8750c862

Contents?: true

Size: 481 Bytes

Versions: 109

Compression:

Stored size: 481 Bytes

Contents

module WebSocket
  module HTTP

    class Response
      include Headers

      STATUS_LINE = /^(HTTP\/[0-9]+\.[0-9]+) ([0-9]{3}) ([\x20-\x7e]+)$/

      attr_reader :code

      def [](name)
        @headers[HTTP.normalize_header(name)]
      end

      def body
        @buffer.pack('C*')
      end

    private

      def start_line(line)
        return false unless parsed = line.scan(STATUS_LINE).first
        @code = parsed[1].to_i
        true
      end
    end

  end
end

Version data entries

109 entries across 81 versions & 11 rubygems

Version Path
kinetic_sdk-5.0.2.beta.4 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.4 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.3 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.3 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.2 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.2 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.1 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-5.0.2.beta.1 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.1 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.1 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-5.0.0 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-5.0.0 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-1.0.2 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-1.0.2 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-1.0.1 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-1.0.1 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
kinetic_sdk-1.0.0 gems/websocket-driver-0.6.5/lib/websocket/http/response.rb
kinetic_sdk-1.0.0 gems/websocket-driver-0.6.5-java/lib/websocket/http/response.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/websocket-driver-0.7.1/lib/websocket/http/response.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/websocket-driver-0.7.1/lib/websocket/http/response.rb