Class: Twilio::REST::Api::V2010::AccountContext::MessagePageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/message.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) ⇒ MessagePageMetadata

Returns a new instance of MessagePageMetadata.



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/twilio-ruby/rest/api/v2010/account/message.rb', line 694

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

#message_pageObject (readonly)

Returns the value of attribute message_page.



692
693
694
# File 'lib/twilio-ruby/rest/api/v2010/account/message.rb', line 692

def message_page
  @message_page
end

Instance Method Details

#eachObject



710
711
712
713
714
# File 'lib/twilio-ruby/rest/api/v2010/account/message.rb', line 710

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

#to_sObject



716
717
718
# File 'lib/twilio-ruby/rest/api/v2010/account/message.rb', line 716

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