Sha256: 94dad1b9a785ad5393bf0a8a5322e223c5ec68657e6e309476385b3bc537dc0e

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

# -*- encoding: utf-8 -*-

# Subclasses of URI::Generic to ease working with Stomp URIs.
module OnStomp::Components::URI
  # A URI class for representing URIs with a 'stomp' scheme.
  class STOMP < ::URI::Generic
    # The default port to use for these kinds of URI objects when none has
    # been specified.
    DEFAULT_PORT = 61613
    # The type of socket to use with these kinds of URI objects.
    # @return [:tcp]
    def onstomp_socket_type; :tcp; end
  end
  
  # A URI class for representing URIs with a 'stomp+ssl' scheme.
  class STOMP_SSL < STOMP
    # The default port to use for these kinds of URI objects when none has
    # been specified.
    DEFAULT_PORT = 61612
    # The type of socket to use with these kinds of URI objects.
    # @return [:ssl]
    def onstomp_socket_type; :ssl; end
  end
end

# Add the new URI classes to `URI`'s set of known schemes.
module ::URI
  @@schemes['STOMP'] = OnStomp::Components::URI::STOMP
  @@schemes['STOMP+SSL'] = OnStomp::Components::URI::STOMP_SSL
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
onstomp-1.0.2 lib/onstomp/components/uri.rb
onstomp-1.0.1 lib/onstomp/components/uri.rb