Class: Ably::Models::ChannelDetails

Inherits:
Object
  • Object
show all
Extended by:
Ably::Modules::Enum, Forwardable
Includes:
Ably::Modules::ModelCommon
Defined in:
lib/submodules/ably-ruby/lib/ably/models/channel_details.rb

Overview

Contains the details of a Rest::Channel or Realtime::Channel object such as its ID and ChannelStatus.

Instance Attribute Summary collapse

Attributes included from Ably::Modules::ModelCommon

#hash

Instance Method Summary collapse

Methods included from Ably::Modules::ModelCommon

#==, #[], #as_json, included, #to_json, #to_s

Methods included from Ably::Modules::MessagePack

#to_msgpack

Constructor Details

#initialize(attrs) ⇒ ChannelDetails

Initialize a new ChannelDetails



35
36
37
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_details.rb', line 35

def initialize(attrs)
  @attributes = IdiomaticRubyWrapper(attrs.clone)
end

Instance Attribute Details

#attributesObject (readonly) Also known as: to_h

The attributes of ChannelDetails



29
30
31
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_details.rb', line 29

def attributes
  @attributes
end

Instance Method Details

#channel_idString

The identifier of the channel

Returns:

  • (String)


45
46
47
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_details.rb', line 45

def channel_id
  attributes[:channel_id]
end

#nameString

The identifier of the channel

Returns:

  • (String)


55
56
57
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_details.rb', line 55

def name
  attributes[:name]
end

#statusAbly::Models::ChannelStatus?

Returns:



65
66
67
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_details.rb', line 65

def status
  Ably::Models::ChannelStatus(attributes[:status])
end