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

- old
+ new

@@ -31,14 +31,11 @@ # not set will use the default value of 50 records. If no page_size is defined # but a limit is defined, stream() will attempt to read the limit with the most # efficient page size, i.e. min(limit, 1000) # @return [Array] Array of up to limit results def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries + self.stream(limit: limit, page_size: page_size).entries end ## # Streams CredentialInstance records from the API as an Enumerable. # This operation lazily loads records as efficiently as possible until the limit @@ -51,13 +48,11 @@ # efficient page size, i.e. min(limit, 1000) # @return [Enumerable] Enumerable that will yield up to limit results def stream(limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) - 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]) end ## @@ -65,13 +60,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 @@ -136,14 +129,11 @@ 'POST', @uri, data: data ) - CredentialInstance.new( - @version, - payload, - ) + CredentialInstance.new(@version, payload,) end ## # Provide a user friendly representation def to_s @@ -168,14 +158,11 @@ ## # Build an instance of CredentialInstance # @param [Hash] payload Payload response from the API # @return [CredentialInstance] CredentialInstance def get_instance(payload) - CredentialInstance.new( - @version, - payload, - ) + CredentialInstance.new(@version, payload,) end ## # Provide a user friendly representation def to_s @@ -191,13 +178,11 @@ # @return [CredentialContext] CredentialContext def initialize(version, sid) super(version) # Path Solution - @solution = { - sid: sid, - } + @solution = {sid: sid,} @uri = "/Credentials/#{@solution[:sid]}" end ## # Fetch a CredentialInstance @@ -209,15 +194,11 @@ 'GET', @uri, params, ) - CredentialInstance.new( - @version, - payload, - sid: @solution[:sid], - ) + CredentialInstance.new(@version, payload, sid: @solution[:sid],) end ## # Update the CredentialInstance # @param [String] friendly_name The friendly_name @@ -241,15 +222,11 @@ 'POST', @uri, data: data, ) - CredentialInstance.new( - @version, - payload, - sid: @solution[:sid], - ) + CredentialInstance.new(@version, payload, sid: @solution[:sid],) end ## # Deletes the CredentialInstance # @return [Boolean] true if delete succeeds, true otherwise @@ -287,24 +264,19 @@ '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 [CredentialContext] CredentialContext for this CredentialInstance def context unless @instance_context - @instance_context = CredentialContext.new( - @version, - @params['sid'], - ) + @instance_context = CredentialContext.new(@version, @params['sid'],) end @instance_context end ## \ No newline at end of file