class Ably::Models::ChannelStatus

Contains the status of a {Ably::Models::Rest::Channel} or {Ably::Models::Realtime::Channel} object such as whether it is active and its {Ably::Models::ChannelOccupancy}.

@spec CHS1

Attributes

attributes[R]

The attributes of ChannelStatus

@spec CHS2

to_h[R]

The attributes of ChannelStatus

@spec CHS2

Public Class Methods

new(attrs) click to toggle source

Initialize a new ChannelStatus

# File lib/submodules/ably-ruby/lib/ably/models/channel_status.rb, line 37
def initialize(attrs)
  @attributes = IdiomaticRubyWrapper(attrs.clone)
end

Public Instance Methods

active?()
Alias for: is_active
is_active() click to toggle source

If true, the channel is active, otherwise false.

@spec CHS2a

@return [Boolean]

# File lib/submodules/ably-ruby/lib/ably/models/channel_status.rb, line 47
def is_active
  attributes[:isActive]
end
Also aliased as: active?, is_active?
is_active?()
Alias for: is_active
occupancy() click to toggle source

A {Ably::Models::ChannelOccupancy} object.

@spec CHS2b

@return [Ably::Models::ChannelOccupancy, nil]

# File lib/submodules/ably-ruby/lib/ably/models/channel_status.rb, line 59
def occupancy
  Ably::Models::ChannelOccupancy(attributes[:occupancy])
end