Class: Ably::Realtime::Channel::PushChannel

Inherits:
Object
  • Object
show all
Defined in:
lib/ably/realtime/channel/push_channel.rb

Overview

Enables devices to subscribe to push notifications for a channel.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ PushChannel

Returns a new instance of PushChannel.

Raises:

  • (ArgumentError)


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

#channelObject (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

Note:

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

Note:

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

Note:

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_sObject



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

Note:

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

Note:

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