lib/ably/models/channel_status.rb in ably-1.2.2 vs lib/ably/models/channel_status.rb in ably-1.2.3

- old
+ new

@@ -2,48 +2,58 @@ # Convert token details argument to a {ChannelStatus} object # # @param attributes (see #initialize) # # @return [ChannelStatus] + # def self.ChannelStatus(attributes) case attributes when ChannelStatus return attributes else ChannelStatus.new(attributes) end end - # ChannelStatus is a type that contains status and occupancy for a channel (CHS1) + # 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 + # class ChannelStatus extend Ably::Modules::Enum extend Forwardable include Ably::Modules::ModelCommon - # The attributes of ChannelStatus (CHS2) + # The attributes of ChannelStatus # + # @spec CHS2 + # attr_reader :attributes alias_method :to_h, :attributes # Initialize a new ChannelStatus # def initialize(attrs) @attributes = IdiomaticRubyWrapper(attrs.clone) end - # Represents if the channel is active (CHS2a) + # If true, the channel is active, otherwise false. # + # @spec CHS2a + # # @return [Boolean] # def is_active attributes[:isActive] end alias_method :active?, :is_active alias_method :is_active?, :is_active - # Occupancy ChannelOccupancy – occupancy is an object containing the metrics for the channel (CHS2b) + # A {Ably::Models::ChannelOccupancy} object. + # + # @spec CHS2b # # @return [Ably::Models::ChannelOccupancy, nil] # def occupancy Ably::Models::ChannelOccupancy(attributes[:occupancy])