Sha256: 04377d5dd5a4427f7fbf73c1b4900da801e18f0c607578a0afda13b113982b9d

Contents?: true

Size: 640 Bytes

Versions: 13

Compression:

Stored size: 640 Bytes

Contents

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

class OnStomp::Client
  class << self
    # Creates an alias chain for {OnStomp::Client.new} so that if
    # a failover: URI or an array of URIs are passed to the constructor,
    # a {OnStomp::Failover::Client failover} client is built instead.
    # @return [OnStomp::Client,OnStomp::Failover::Client]
    def new_with_failover(uri, options={})
      if uri.is_a?(Array) || uri.to_s =~ /^failover:/i
        OnStomp::Failover::Client.new(uri, options)
      else
        new_without_failover(uri, options)
      end
    end
    
    alias :new_without_failover :new
    alias :new :new_with_failover
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onstomp-1.0.12 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.11 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.10 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.9 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.8 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.7 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.6 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.5 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.4 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.3 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.2 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.1 lib/onstomp/failover/new_with_failover.rb
onstomp-1.0.0 lib/onstomp/failover/new_with_failover.rb