Class: Twilio::REST::Accounts::V1::BulkConsentsPageMetadata

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

Returns a new instance of BulkConsentsPageMetadata.



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

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

Returns the value of attribute bulk_consents_page.



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

def bulk_consents_page
  @bulk_consents_page
end

Instance Method Details

#eachObject



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

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

#to_sObject



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

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