Class: Twilio::REST::Accounts::V1::MessagingGeopermissionsPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.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) ⇒ MessagingGeopermissionsPageMetadata

Returns a new instance of MessagingGeopermissionsPageMetadata.



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 186

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

#messaging_geopermissions_pageObject (readonly)

Returns the value of attribute messaging_geopermissions_page.



184
185
186
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 184

def messaging_geopermissions_page
  @messaging_geopermissions_page
end

Instance Method Details

#eachObject



202
203
204
205
206
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 202

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

#to_sObject



208
209
210
# File 'lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb', line 208

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