Sha256: c834df49b2ce63f77527ad7e4f3e7c8d41bf089eaf15b7358fe27e7f0f5538ec

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

module Stomper
  module Frames
    # Encapsulates an "UNSUBSCRIBE" frame from the Stomp Protocol.
    #
    # See the {Stomp Protocol Specification}[http://stomp.codehaus.org/Protocol]
    # for more details.
    class Unsubscribe < Stomper::Frames::ClientFrame
      def initialize(destination, headers={})
        super('UNSUBSCRIBE', headers)
        @headers['destination'] = destination
      end

      # Returns the id of the subscription being unsubscribed from, if it
      # exists.
      #
      # This is a convenience method, and may also be accessed through
      # frame.headers.id or frame.headers[:id] or frame.headers['id']
      def id
        @headers['id']
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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