Class: Twilio::REST::Conversations::V1::ServiceContext::ConversationContext::WebhookPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.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) ⇒ WebhookPageMetadata

Returns a new instance of WebhookPageMetadata.



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 532

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

#webhook_pageObject (readonly)

Returns the value of attribute webhook_page.



530
531
532
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 530

def webhook_page
  @webhook_page
end

Instance Method Details

#eachObject



548
549
550
551
552
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 548

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

#to_sObject



554
555
556
# File 'lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb', line 554

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