lib/twilio-ruby/rest/video/v1/room.rb in twilio-ruby-5.4.2 vs lib/twilio-ruby/rest/video/v1/room.rb in twilio-ruby-5.4.3
- old
+ new
@@ -52,14 +52,11 @@
'POST',
@uri,
data: data
)
- RoomInstance.new(
- @version,
- payload,
- )
+ RoomInstance.new(@version, payload,)
end
##
# Lists RoomInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
@@ -120,13 +117,11 @@
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
- page = self.page(
- page_size: limits[:page_size],
- )
+ page = self.page(page_size: limits[:page_size],)
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
@@ -197,14 +192,11 @@
##
# Build an instance of RoomInstance
# @param [Hash] payload Payload response from the API
# @return [RoomInstance] RoomInstance
def get_instance(payload)
- RoomInstance.new(
- @version,
- payload,
- )
+ RoomInstance.new(@version, payload,)
end
##
# Provide a user friendly representation
def to_s
@@ -220,13 +212,11 @@
# @return [RoomContext] RoomContext
def initialize(version, sid)
super(version)
# Path Solution
- @solution = {
- sid: sid,
- }
+ @solution = {sid: sid,}
@uri = "/Rooms/#{@solution[:sid]}"
# Dependents
@recordings = nil
end
@@ -241,59 +231,42 @@
'GET',
@uri,
params,
)
- RoomInstance.new(
- @version,
- payload,
- sid: @solution[:sid],
- )
+ RoomInstance.new(@version, payload, sid: @solution[:sid],)
end
##
# Update the RoomInstance
# @param [room.RoomStatus] status The status
# @return [RoomInstance] Updated RoomInstance
def update(status: nil)
- data = Twilio::Values.of({
- 'Status' => status,
- })
+ data = Twilio::Values.of({'Status' => status,})
payload = @version.update(
'POST',
@uri,
data: data,
)
- RoomInstance.new(
- @version,
- payload,
- sid: @solution[:sid],
- )
+ RoomInstance.new(@version, payload, sid: @solution[:sid],)
end
##
# Access the recordings
# @return [RoomRecordingList]
# @return [RoomRecordingContext] if sid was passed.
def recordings(sid=:unset)
raise ArgumentError, 'sid cannot be nil' if sid.nil?
if sid != :unset
- return RoomRecordingContext.new(
- @version,
- @solution[:sid],
- sid,
- )
+ return RoomRecordingContext.new(@version, @solution[:sid], sid,)
end
unless @recordings
- @recordings = RoomRecordingList.new(
- @version,
- room_sid: @solution[:sid],
- )
+ @recordings = RoomRecordingList.new(@version, room_sid: @solution[:sid],)
end
@recordings
end
@@ -336,25 +309,20 @@
'links' => payload['links'],
}
# Context
@instance_context = nil
- @params = {
- 'sid' => sid || @properties['sid'],
- }
+ @params = {'sid' => sid || @properties['sid'],}
end
##
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @return [RoomContext] RoomContext for this RoomInstance
def context
unless @instance_context
- @instance_context = RoomContext.new(
- @version,
- @params['sid'],
- )
+ @instance_context = RoomContext.new(@version, @params['sid'],)
end
@instance_context
end
##
@@ -469,12 +437,10 @@
##
# Update the RoomInstance
# @param [room.RoomStatus] status The status
# @return [RoomInstance] Updated RoomInstance
def update(status: nil)
- context.update(
- status: status,
- )
+ context.update(status: status,)
end
##
# Access the recordings
# @return [recordings] recordings
\ No newline at end of file