Class: Twilio::REST::IpMessaging::V2::CredentialPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/ip_messaging/v2/credential.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) ⇒ CredentialPageMetadata



521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/twilio-ruby/rest/ip_messaging/v2/credential.rb', line 521

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

#credential_pageObject (readonly)

Returns the value of attribute credential_page.



519
520
521
# File 'lib/twilio-ruby/rest/ip_messaging/v2/credential.rb', line 519

def credential_page
  @credential_page
end

Instance Method Details

#eachObject



537
538
539
540
541
# File 'lib/twilio-ruby/rest/ip_messaging/v2/credential.rb', line 537

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

#to_sObject



543
544
545
# File 'lib/twilio-ruby/rest/ip_messaging/v2/credential.rb', line 543

def to_s
  '<Twilio::REST::IpMessaging::V2PageMetadata>';
end