lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.4.2 vs lib/twilio-ruby/rest/fax/v1/fax.rb in twilio-ruby-5.4.3

- old
+ new

@@ -91,13 +91,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 @@ -187,14 +185,11 @@ 'POST', @uri, data: data ) - FaxInstance.new( - @version, - payload, - ) + FaxInstance.new(@version, payload,) end ## # Provide a user friendly representation def to_s @@ -221,14 +216,11 @@ ## # Build an instance of FaxInstance # @param [Hash] payload Payload response from the API # @return [FaxInstance] FaxInstance def get_instance(payload) - FaxInstance.new( - @version, - payload, - ) + FaxInstance.new(@version, payload,) end ## # Provide a user friendly representation def to_s @@ -246,13 +238,11 @@ # @return [FaxContext] FaxContext def initialize(version, sid) super(version) # Path Solution - @solution = { - sid: sid, - } + @solution = {sid: sid,} @uri = "/Faxes/#{@solution[:sid]}" # Dependents @media = nil end @@ -267,39 +257,29 @@ 'GET', @uri, params, ) - FaxInstance.new( - @version, - payload, - sid: @solution[:sid], - ) + FaxInstance.new(@version, payload, sid: @solution[:sid],) end ## # Update the FaxInstance # @param [fax.UpdateStatus] status The updated status of this fax. The only valid # option is `canceled`. This may fail if the status has already started # transmission. # @return [FaxInstance] Updated FaxInstance def update(status: :unset) - data = Twilio::Values.of({ - 'Status' => status, - }) + data = Twilio::Values.of({'Status' => status,}) payload = @version.update( 'POST', @uri, data: data, ) - FaxInstance.new( - @version, - payload, - sid: @solution[:sid], - ) + FaxInstance.new(@version, payload, sid: @solution[:sid],) end ## # Deletes the FaxInstance # @return [Boolean] true if delete succeeds, true otherwise @@ -313,22 +293,15 @@ # @return [FaxMediaContext] if sid was passed. def media(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset - return FaxMediaContext.new( - @version, - @solution[:sid], - sid, - ) + return FaxMediaContext.new(@version, @solution[:sid], sid,) end unless @media - @media = FaxMediaList.new( - @version, - fax_sid: @solution[:sid], - ) + @media = FaxMediaList.new(@version, fax_sid: @solution[:sid],) end @media end @@ -374,25 +347,20 @@ 'url' => payload['url'], } # 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 [FaxContext] FaxContext for this FaxInstance def context unless @instance_context - @instance_context = FaxContext.new( - @version, - @params['sid'], - ) + @instance_context = FaxContext.new(@version, @params['sid'],) end @instance_context end ## @@ -515,12 +483,10 @@ # @param [fax.UpdateStatus] status The updated status of this fax. The only valid # option is `canceled`. This may fail if the status has already started # transmission. # @return [FaxInstance] Updated FaxInstance def update(status: :unset) - context.update( - status: status, - ) + context.update(status: status,) end ## # Deletes the FaxInstance # @return [Boolean] true if delete succeeds, true otherwise \ No newline at end of file