Class: Ably::Models::ChannelStatus

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

Overview

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

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) ⇒ ChannelStatus

Initialize a new ChannelStatus



37
38
39
# File 'lib/ably/models/channel_status.rb', line 37

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

Instance Attribute Details

#attributesObject (readonly) Also known as: to_h

The attributes of ChannelStatus



31
32
33
# File 'lib/ably/models/channel_status.rb', line 31

def attributes
  @attributes
end

Instance Method Details

#is_activeBoolean Also known as: active?, is_active?

If true, the channel is active, otherwise false.

Returns:

  • (Boolean)


47
48
49
# File 'lib/ably/models/channel_status.rb', line 47

def is_active
  attributes[:isActive]
end

#occupancyAbly::Models::ChannelOccupancy?



59
60
61
# File 'lib/ably/models/channel_status.rb', line 59

def occupancy
  Ably::Models::ChannelOccupancy(attributes[:occupancy])
end