Sha256: a15db6ab8b7a7ff764867ef36597312ee0fabb06df729b4b472ab74145e31a99

Contents?: true

Size: 481 Bytes

Versions: 23

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

23 entries across 22 versions & 9 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
websocket-driver-0.7.7-java lib/websocket/http/response.rb
websocket-driver-0.7.7 lib/websocket/http/response.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/websocket-driver-0.7.6/lib/websocket/http/response.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/websocket-driver-0.7.5/lib/websocket/http/response.rb
websocket-driver-0.7.6-java lib/websocket/http/response.rb
websocket-driver-0.7.6 lib/websocket/http/response.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/websocket-driver-0.7.5/lib/websocket/http/response.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.5/lib/websocket/http/response.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/websocket-driver-0.7.5/lib/websocket/http/response.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/websocket-driver-0.7.5/lib/websocket/http/response.rb
websocket-driver-0.7.5-java lib/websocket/http/response.rb
websocket-driver-0.7.5 lib/websocket/http/response.rb
websocket-driver-0.7.4-java lib/websocket/http/response.rb