Class: OnStomp::Components::URI::STOMP
- Inherits:
-
URI::Generic
- Object
- URI::Generic
- OnStomp::Components::URI::STOMP
- Defined in:
- lib/onstomp/components/uri.rb,
lib/onstomp/open-uri.rb
Overview
A URI class for representing URIs with a 'stomp' scheme.
Direct Known Subclasses
Constant Summary
- DEFAULT_PORT =
The default port to use for these kinds of URI objects when none has been specified.
61613
Instance Method Summary (collapse)
-
- (:tcp) onstomp_socket_type
The type of socket to use with these kinds of URI objects.
-
- (OnStomp::Client) open(*args) {|client| ... }
Creates a new OnStomp::Client, extends it with OpenURI::ClientExtensions and either returns it directly or connects it, yields it to a given block and the disconnects it.
Instance Method Details
- (:tcp) onstomp_socket_type
The type of socket to use with these kinds of URI objects.
12 |
# File 'lib/onstomp/components/uri.rb', line 12 def onstomp_socket_type; :tcp; end |
- (OnStomp::Client) open(*args) {|client| ... }
Creates a new OnStomp::Client, extends it with OpenURI::ClientExtensions and either returns it directly or connects it, yields it to a given block and the disconnects it.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/onstomp/open-uri.rb', line 12 def open(*args) client = OnStomp::Client.new(self, *args) client.extend OnStomp::OpenURI::ClientExtensions client.auto_destination = self.path if block_given? begin client.connect yield client ensure client.disconnect end end client end |