lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -11,11 +11,10 @@ class PhoneNumberList < ListResource class CountryList < ListResource ## # Initialize the CountryList # @param [Version] version Version that contains the resource - # @return [CountryList] CountryList def initialize(version) super(version) # Path Solution @@ -31,11 +30,10 @@ # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when 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 @@ -50,11 +48,10 @@ # guarantees to never return more than limit. Default is no limit # @param [Integer] page_size Number of records to fetch per request, when 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 [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( @@ -90,11 +87,10 @@ # Retrieve a single page of CountryInstance records from the API. # Request is executed immediately. # @param [String] page_token PageToken provided by the API # @param [Integer] page_number Page Number, this value is simply for client state # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of CountryInstance def page(page_token: nil, page_number: nil, page_size: nil) params = { 'PageToken' => page_token, 'Page' => page_number, @@ -119,11 +115,10 @@ ## # Initialize the CountryPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource - # @return [CountryPage] CountryPage def initialize(version, response, solution) super(version, response) # Path Solution @@ -131,11 +126,10 @@ end ## # Build an instance of CountryInstance # @param [Hash] payload Payload response from the API - # @return [CountryInstance] CountryInstance def get_instance(payload) return CountryInstance.new( @version, payload, @@ -152,11 +146,10 @@ class CountryContext < InstanceContext ## # Initialize the CountryContext # @param [Version] version Version that contains the resource # @param [String] iso_country The iso_country - # @return [CountryContext] CountryContext def initialize(version, iso_country) super(version) # Path Solution @@ -179,11 +172,11 @@ ) return CountryInstance.new( @version, payload, - iso_country: @solution['iso_country'], + iso_country: @solution[:iso_country], ) end ## # Provide a user friendly representation @@ -197,11 +190,10 @@ ## # Initialize the CountryInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] iso_country The iso_country - # @return [CountryInstance] CountryInstance def initialize(version, payload, iso_country: nil) super(version) # Marshaled Properties @@ -223,11 +215,10 @@ ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @param [Version] version Version that contains the resource - # @return [CountryContext] CountryContext for this CountryInstance def context unless @instance_context @instance_context = CountryContext.new( @version, @@ -263,17 +254,17 @@ ## # Fetch a CountryInstance # @return [CountryInstance] Fetched CountryInstance def fetch - @context.fetch() + context.fetch end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Pricing.V1.CountryInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Pricing.V1.CountryInstance #{values}>" end end end end end \ No newline at end of file