class Ably::Rest::Channels

Public Class Methods

new(client) click to toggle source

@return [Ably::Rest::Channels]

Calls superclass method Ably::Modules::ChannelsCollection::new
# File lib/submodules/ably-ruby/lib/ably/rest/channels.rb, line 7
def initialize(client)
  super client, Ably::Rest::Channel
end

Public Instance Methods

fetch(*args) click to toggle source

Return a {Ably::Rest::Channel} for the given name if it exists, else the block will be called. This method is intentionally similar to {ruby-doc.org/core-2.1.3/Hash.html#method-i-fetch Hash#fetch} providing a simple way to check if a channel exists or not without creating one

@param name [String] The name of the channel @yield [options] (optional) if a missing_block is passed to this method and no channel exists matching the name, this block is called @yieldparam [String] name of the missing channel

@return [Ably::Rest::Channel]

Calls superclass method Ably::Modules::ChannelsCollection#fetch
# File lib/submodules/ably-ruby/lib/ably/rest/channels.rb, line 31
def fetch(*args)
  super
end
get(*args) click to toggle source

Return a {Ably::Rest::Channel} for the given name

@param name [String] The name of the channel @param channel_options [Hash] Channel options, currently reserved for Encryption options

@return [Ably::Rest::Channel]

Calls superclass method Ably::Modules::ChannelsCollection#get
# File lib/submodules/ably-ruby/lib/ably/rest/channels.rb, line 18
def get(*args)
  super
end
release(*args) click to toggle source

Destroy the {Ably::Rest::Channel} and releases the associated resources.

Releasing a {Ably::Rest::Channel} is not typically necessary as a channel consumes no resources other than the memory footprint of the {Ably::Rest::Channel} object. Explicitly release channels to free up resources if required

@return [void]

# File lib/submodules/ably-ruby/lib/ably/rest/channels.rb, line 42
def release(*args)
  super
end