class Ably::Realtime::Channel::PushChannel

Enables devices to subscribe to push notifications for a channel.

Attributes

channel[R]

Public Class Methods

new(channel) click to toggle source
# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 8
def initialize(channel)
  raise ArgumentError, "Unsupported channel type '#{channel.class}'" unless channel.kind_of?(Ably::Realtime::Channel)
  @channel = channel
end

Public Instance Methods

get_subscriptions(*args) click to toggle source

Retrieves all push subscriptions for the channel. Subscriptions can be filtered using a params object. Returns a {Ably::Models::PaginatedResult} object containing an array of {Ably::Models::PushChannelSubscription} objects.

@spec RSH7e

@note This is unsupported in the Ruby library

# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 59
def get_subscriptions(*args)
  raise_unsupported
end
subscribe_client_id(*args) click to toggle source

Subscribes all devices associated with the current device’s clientId to push notifications for the channel.

@spec RSH7b

@note This is unsupported in the Ruby library

# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 31
def subscribe_client_id(*args)
  raise_unsupported
end
subscribe_device(*args) click to toggle source

Subscribes the device to push notifications for the channel.

@spec RSH7a

@note This is unsupported in the Ruby library

# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 22
def subscribe_device(*args)
  raise_unsupported
end
to_s() click to toggle source
# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 13
def to_s
  "<PushChannel: name=#{channel.name}>"
end
unsubscribe_client_id(*args) click to toggle source

Unsubscribes all devices associated with the current device’s clientId from receiving push notifications for the channel.

@spec RSH7d

@note This is unsupported in the Ruby library

# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 49
def unsubscribe_client_id(*args)
  raise_unsupported
end
unsubscribe_device(*args) click to toggle source

Unsubscribes the device from receiving push notifications for the channel.

@spec RSH7c

@note This is unsupported in the Ruby library

# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 40
def unsubscribe_device(*args)
  raise_unsupported
end

Private Instance Methods

raise_unsupported() click to toggle source
# File lib/submodules/ably-ruby/lib/ably/realtime/channel/push_channel.rb, line 64
def raise_unsupported
  raise Ably::Exceptions::PushNotificationsNotSupported, 'This device does not support receiving or subscribing to push notifications. All PushChannel methods are unavailable'
end