Class: Twilio::REST::IpMessaging::V2::ServiceContext::ChannelPageMetadata

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

Returns a new instance of ChannelPageMetadata.



634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb', line 634

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

#channel_pageObject (readonly)

Returns the value of attribute channel_page.



632
633
634
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb', line 632

def channel_page
  @channel_page
end

Instance Method Details

#eachObject



650
651
652
653
654
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb', line 650

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

#to_sObject



656
657
658
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb', line 656

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