Sha256: cbc4bfcbe086b8a03b1eb7e63702b40581c93797ddbf2d18e61e9215c1057602

Contents?: true

Size: 1.92 KB

Versions: 26

Compression:

Stored size: 1.92 KB

Contents

module Ably::Rest
  class Channel
    # A push channel used for push notifications
    # Each PushChannel maps to exactly one Rest Channel
    #
    # @!attribute [r] channel
    #   @return [Ably::Rest::Channel] Underlying channel object
    #
    class PushChannel
      attr_reader :channel

      def initialize(channel)
        raise ArgumentError, "Unsupported channel type '#{channel.class}'" unless channel.kind_of?(Ably::Rest::Channel)
        @channel = channel
      end

      def to_s
        "<PushChannel: name=#{channel.name}>"
      end

      # Subscribe local device for push notifications on this channel
      #
      # @note This is unsupported in the Ruby library
      def subscribe_device(*args)
        raise_unsupported
      end

      # Subscribe all devices registered to this client's authenticated client_id for push notifications on this channel
      #
      # @note This is unsupported in the Ruby library
      def subscribe_client_id(*args)
        raise_unsupported
      end

      # Unsubscribe local device for push notifications on this channel
      #
      # @note This is unsupported in the Ruby library
      def unsubscribe_device(*args)
        raise_unsupported
      end

      # Unsubscribe all devices registered to this client's authenticated client_id for push notifications on this channel
      #
      # @note This is unsupported in the Ruby library
      def unsubscribe_client_id(*args)
        raise_unsupported
      end

      # Get list of subscriptions on this channel for this device or authenticate client_id
      #
      # @note This is unsupported in the Ruby library
      def get_subscriptions(*args)
        raise_unsupported
      end

      private
      def raise_unsupported
        raise Ably::Exceptions::PushNotificationsNotSupported, 'This device does not support receiving or subscribing to push notifications. All PushChannel methods are unavailable'
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
ably-rest-1.2.2 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.2.2 lib/ably/rest/channel/push_channel.rb
ably-rest-1.2.1 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.2.1 lib/ably/rest/channel/push_channel.rb
ably-rest-1.2.0 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.2.0 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.8 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.8 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.7 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.7 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.6 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.6 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.5 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.5 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.4 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.4 lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.4.rc lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.4.rc lib/ably/rest/channel/push_channel.rb
ably-rest-1.1.3 lib/submodules/ably-ruby/lib/ably/rest/channel/push_channel.rb
ably-1.1.3 lib/ably/rest/channel/push_channel.rb