Sha256: 1a33db428381fb0d6befe8522fd682b5a90d41438f273c1e258f7e94451a3536

Contents?: true

Size: 718 Bytes

Versions: 162

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

module ActionCable
  module SubscriptionAdapter
    module ChannelPrefix # :nodoc:
      def broadcast(channel, payload)
        channel = channel_with_prefix(channel)
        super
      end

      def subscribe(channel, callback, success_callback = nil)
        channel = channel_with_prefix(channel)
        super
      end

      def unsubscribe(channel, callback)
        channel = channel_with_prefix(channel)
        super
      end

      private
        # Returns the channel name, including channel_prefix specified in cable.yml
        def channel_with_prefix(channel)
          [@server.config.cable[:channel_prefix], channel].compact.join(":")
        end
    end
  end
end

Version data entries

162 entries across 157 versions & 12 rubygems

Version Path
actioncable-7.1.5 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.4.2 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.0.8.6 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-6.1.7.10 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-6.1.7.9 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.4.1 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.0.8.5 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.4 lib/action_cable/subscription_adapter/channel_prefix.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actioncable-7.0.8.4/lib/action_cable/subscription_adapter/channel_prefix.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actioncable-7.1.3.4/lib/action_cable/subscription_adapter/channel_prefix.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/channel_prefix.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/channel_prefix.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actioncable-7.0.5.1/lib/action_cable/subscription_adapter/channel_prefix.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/actioncable-7.1.3.4/lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.3.4 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.0.8.4 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-6.1.7.8 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.3.2 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.1.3.1 lib/action_cable/subscription_adapter/channel_prefix.rb
actioncable-7.0.8.1 lib/action_cable/subscription_adapter/channel_prefix.rb