Class: Ably::Models::ChannelOccupancy

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

Overview

Contains the metrics of a Rest::Channel or Realtime::Channel object.

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

Initialize a new ChannelOccupancy



36
37
38
# File 'lib/ably/models/channel_occupancy.rb', line 36

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

Instance Attribute Details

#attributesObject (readonly) Also known as: to_h

The attributes of ChannelOccupancy.



30
31
32
# File 'lib/ably/models/channel_occupancy.rb', line 30

def attributes
  @attributes
end

Instance Method Details

#metricsAbly::Models::ChannelMetrics?



46
47
48
# File 'lib/ably/models/channel_occupancy.rb', line 46

def metrics
  Ably::Models::ChannelMetrics(attributes[:metrics])
end