Class: Twilio::REST::Api::V2010::AccountPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account.rb

Constant Summary

Constants inherited from PageMetadata

PageMetadata::META_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PageMetadata

#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution, limit) ⇒ AccountPageMetadata

Returns a new instance of AccountPageMetadata.



877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 877

def initialize(version, response, solution, limit)
    super(version, response)
    @account_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @account_page << AccountListResponse.new(version, @payload, key, limit - records)
        @payload = self.next_page
        break unless @payload
        records += (@payload.body[key] || []).size
    end
    # Path Solution
    @solution = solution
end

Instance Attribute Details

#account_pageObject (readonly)

Returns the value of attribute account_page.



875
876
877
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 875

def 
  @account_page
end

Instance Method Details

#eachObject



893
894
895
896
897
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 893

def each
    @account_page.each do |record|
      yield record
    end
end

#to_sObject



899
900
901
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 899

def to_s
  '<Twilio::REST::Api::V2010PageMetadata>';
end