Class: Twilio::REST::Accounts::V1::BulkContactsPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/bulk_contacts.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) ⇒ BulkContactsPageMetadata

Returns a new instance of BulkContactsPageMetadata.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb', line 132

def initialize(version, response, solution, limit)
    super(version, response)
    @bulk_contacts_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @bulk_contacts_page << BulkContactsListResponse.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

#bulk_contacts_pageObject (readonly)

Returns the value of attribute bulk_contacts_page.



130
131
132
# File 'lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb', line 130

def bulk_contacts_page
  @bulk_contacts_page
end

Instance Method Details

#eachObject



148
149
150
151
152
# File 'lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb', line 148

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

#to_sObject



154
155
156
# File 'lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb', line 154

def to_s
  '<Twilio::REST::Accounts::V1PageMetadata>';
end