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.



869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 869

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.



867
868
869
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 867

def 
  @account_page
end

Instance Method Details

#eachObject



885
886
887
888
889
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 885

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

#to_sObject



891
892
893
# File 'lib/twilio-ruby/rest/api/v2010/account.rb', line 891

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