Sha256: e85d4ae265dbe991e8edd1d6ea0501b89285e5e4cf8d5f9795ae2a56ae3ee3fe

Contents?: true

Size: 545 Bytes

Versions: 22

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

module AnyCable
  module Refinements
    module Subscriptions # :nodoc:
      refine ActionCable::Connection::Subscriptions do
        # Find or add a subscription to the list
        def fetch(identifier)
          add("identifier" => identifier) unless subscriptions[identifier]

          unless subscriptions[identifier]
            raise "Channel not found: #{ActiveSupport::JSON.decode(identifier).fetch("channel")}"
          end

          subscriptions[identifier]
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
anycable-rails-1.2.1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.2.0 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.4 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.3 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.8 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.2 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.0 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.0.rc1.1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.0.rc1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.1.0.pre1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.7 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.5 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.4 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.3 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.2 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.1 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.0 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.0.rc4 lib/anycable/rails/refinements/subscriptions.rb
anycable-rails-1.0.0.rc3 lib/anycable/rails/refinements/subscriptions.rb