lib/submodules/ably-ruby/lib/ably/models/channel_occupancy.rb in ably-rest-1.2.2 vs lib/submodules/ably-ruby/lib/ably/models/channel_occupancy.rb in ably-rest-1.2.3
- old
+ new
@@ -2,38 +2,45 @@
# Convert token details argument to a {ChannelOccupancy} object
#
# @param attributes (see #initialize)
#
# @return [ChannelOccupancy]
+ #
def self.ChannelOccupancy(attributes)
case attributes
when ChannelOccupancy
return attributes
else
ChannelOccupancy.new(attributes)
end
end
- # Type that contain channel metrics (CHO1)
+ # Contains the metrics of a {Ably::Models::Rest::Channel} or {Ably::Models::Realtime::Channel} object.
#
+ # @spec CHO1
+ #
class ChannelOccupancy
extend Ably::Modules::Enum
extend Forwardable
include Ably::Modules::ModelCommon
- # The attributes of ChannelOccupancy (CH02)
+ # The attributes of ChannelOccupancy.
#
+ # @spec CH02
+ #
attr_reader :attributes
alias_method :to_h, :attributes
# Initialize a new ChannelOccupancy
#
def initialize(attrs)
@attributes = IdiomaticRubyWrapper(attrs.clone)
end
- # Metrics object (CHO2a)
+ # A {Ably::Models::ChannelMetrics} object.
+ #
+ # @spec CHO2a
#
# @return [Ably::Models::ChannelMetrics, nil]
#
def metrics
Ably::Models::ChannelMetrics(attributes[:metrics])