Sha256: e5373e5ab01c7f199af5afe1df8256f1948cebb239cec1f10444ec7d6ff5d3f4

Contents?: true

Size: 848 Bytes

Versions: 4

Compression:

Stored size: 848 Bytes

Contents

module Stomper
  module Frames
    # Encapsulates a "CONNECTED" server side frame for the Stomp Protocol.
    #
    # See the {Stomp Protocol Specification}[http://stomp.codehaus.org/Protocol]
    # for more details.
    class Connected < Stomper::Frames::ServerFrame
      # This class is a factory for incoming 'CONNECTED' commands.
      factory_for :connected

      # Builds a Connected frame instance with the supplied
      # +headers+ and +body+
      def initialize(headers, body)
        super('CONNECTED', headers, body)
      end

      # A convenience method that returns the value of
      # the session header, if it is set.
      #
      # This value can also be accessed as:
      # frame.headers.session or frame.headers['session'] or frame.headers[:session]
      def session
        @headers.session
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stomper-0.4 lib/stomper/frames/connected.rb
stomper-0.3.2 lib/stomper/frames/connected.rb
stomper-0.3.1 lib/stomper/frames/connected.rb
stomper-0.3.0 lib/stomper/frames/connected.rb