Class: Twilio::REST::IpMessaging::V2::ServiceContext::ChannelContext::WebhookPageMetadata

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



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 538

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.



536
537
538
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 536

def webhook_page
  @webhook_page
end

Instance Method Details

#eachObject



554
555
556
557
558
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 554

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

#to_sObject



560
561
562
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb', line 560

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