Class: Ably::Models::ChannelStatus
- Inherits:
-
Object
- Object
- Ably::Models::ChannelStatus
- Extended by:
- Ably::Modules::Enum, Forwardable
- Includes:
- Ably::Modules::ModelCommon
- Defined in:
- lib/submodules/ably-ruby/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 ⇒ Object
(also: #to_h)
readonly
The attributes of ChannelStatus.
Attributes included from Ably::Modules::ModelCommon
Instance Method Summary collapse
-
#initialize(attrs) ⇒ ChannelStatus
constructor
Initialize a new ChannelStatus.
-
#is_active ⇒ Boolean
(also: #active?, #is_active?)
If true, the channel is active, otherwise false.
-
#occupancy ⇒ Ably::Models::ChannelOccupancy?
A ChannelOccupancy object.
Methods included from Ably::Modules::ModelCommon
#==, #[], #as_json, included, #to_json, #to_s
Methods included from Ably::Modules::MessagePack
Constructor Details
#initialize(attrs) ⇒ ChannelStatus
Initialize a new ChannelStatus
37 38 39 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_status.rb', line 37 def initialize(attrs) @attributes = IdiomaticRubyWrapper(attrs.clone) end |
Instance Attribute Details
#attributes ⇒ Object (readonly) Also known as: to_h
The attributes of ChannelStatus
31 32 33 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_status.rb', line 31 def attributes @attributes end |
Instance Method Details
#is_active ⇒ Boolean Also known as: active?, is_active?
If true, the channel is active, otherwise false.
47 48 49 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_status.rb', line 47 def is_active attributes[:isActive] end |
#occupancy ⇒ Ably::Models::ChannelOccupancy?
A Ably::Models::ChannelOccupancy object.
59 60 61 |
# File 'lib/submodules/ably-ruby/lib/ably/models/channel_status.rb', line 59 def occupancy Ably::Models::ChannelOccupancy(attributes[:occupancy]) end |