Class: Ably::Realtime::Channel::PushChannel
- Inherits:
-
Object
- Object
- Ably::Realtime::Channel::PushChannel
- Defined in:
- lib/ably/realtime/channel/push_channel.rb
Overview
Enables devices to subscribe to push notifications for a channel.
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
Instance Method Summary collapse
-
#get_subscriptions(*args) ⇒ Object
Retrieves all push subscriptions for the channel.
-
#initialize(channel) ⇒ PushChannel
constructor
A new instance of PushChannel.
-
#subscribe_client_id(*args) ⇒ Object
Subscribes all devices associated with the current device’s clientId to push notifications for the channel.
-
#subscribe_device(*args) ⇒ Object
Subscribes the device to push notifications for the channel.
- #to_s ⇒ Object
-
#unsubscribe_client_id(*args) ⇒ Object
Unsubscribes all devices associated with the current device’s clientId from receiving push notifications for the channel.
-
#unsubscribe_device(*args) ⇒ Object
Unsubscribes the device from receiving push notifications for the channel.
Constructor Details
#initialize(channel) ⇒ PushChannel
Returns a new instance of PushChannel.
8 9 10 11 |
# File '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 |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
6 7 8 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 6 def channel @channel end |
Instance Method Details
#get_subscriptions(*args) ⇒ Object
This is unsupported in the Ruby library
Retrieves all push subscriptions for the channel. Subscriptions can be filtered using a params object. Returns a Models::PaginatedResult object containing an array of Models::PushChannelSubscription objects.
59 60 61 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 59 def get_subscriptions(*args) raise_unsupported end |
#subscribe_client_id(*args) ⇒ Object
This is unsupported in the Ruby library
Subscribes all devices associated with the current device’s clientId to push notifications for the channel.
31 32 33 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 31 def subscribe_client_id(*args) raise_unsupported end |
#subscribe_device(*args) ⇒ Object
This is unsupported in the Ruby library
Subscribes the device to push notifications for the channel.
22 23 24 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 22 def subscribe_device(*args) raise_unsupported end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 13 def to_s "<PushChannel: name=#{channel.name}>" end |
#unsubscribe_client_id(*args) ⇒ Object
This is unsupported in the Ruby library
Unsubscribes all devices associated with the current device’s clientId from receiving push notifications for the channel.
49 50 51 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 49 def unsubscribe_client_id(*args) raise_unsupported end |
#unsubscribe_device(*args) ⇒ Object
This is unsupported in the Ruby library
Unsubscribes the device from receiving push notifications for the channel.
40 41 42 |
# File 'lib/ably/realtime/channel/push_channel.rb', line 40 def unsubscribe_device(*args) raise_unsupported end |