Class: Twilio::REST::Insights::V1::RoomContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V1::RoomContext
- Defined in:
- lib/twilio-ruby/rest/insights/v1/room.rb,
lib/twilio-ruby/rest/insights/v1/room/participant.rb
Defined Under Namespace
Classes: ParticipantContext, ParticipantInstance, ParticipantList, ParticipantPage
Instance Method Summary collapse
-
#fetch ⇒ RoomInstance
Fetch the RoomInstance.
-
#initialize(version, room_sid) ⇒ RoomContext
constructor
Initialize the RoomContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#participants(participant_sid = :unset) ⇒ ParticipantList, ParticipantContext
Access the participants.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, room_sid) ⇒ RoomContext
Initialize the RoomContext
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 168 def initialize(version, room_sid) super(version) # Path Solution @solution = { room_sid: room_sid, } @uri = "/Video/Rooms/#{@solution[:room_sid]}" # Dependents @participants = nil end |
Instance Method Details
#fetch ⇒ RoomInstance
Fetch the RoomInstance
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 181 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) RoomInstance.new( @version, payload, room_sid: @solution[:room_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
226 227 228 229 |
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 226 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.RoomContext #{context}>" end |
#participants(participant_sid = :unset) ⇒ ParticipantList, ParticipantContext
Access the participants
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 201 def participants(participant_sid=:unset) raise ArgumentError, 'participant_sid cannot be nil' if participant_sid.nil? if participant_sid != :unset return ParticipantContext.new(@version, @solution[:room_sid],participant_sid ) end unless @participants @participants = ParticipantList.new( @version, room_sid: @solution[:room_sid], ) end @participants end |
#to_s ⇒ Object
Provide a user friendly representation
219 220 221 222 |
# File 'lib/twilio-ruby/rest/insights/v1/room.rb', line 219 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.RoomContext #{context}>" end |