Class: Twilio::REST::Insights::V3::CustomFieldMappingPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/insights/v3/custom_field_mapping.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) ⇒ CustomFieldMappingPageMetadata

Returns a new instance of CustomFieldMappingPageMetadata.



592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 592

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

#custom_field_mapping_page ⇒ Object (readonly)

Returns the value of attribute custom_field_mapping_page.



590
591
592
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 590

def custom_field_mapping_page
  @custom_field_mapping_page
end

Instance Method Details

#each ⇒ Object



608
609
610
611
612
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 608

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

#to_s ⇒ Object



614
615
616
# File 'lib/twilio-ruby/rest/insights/v3/custom_field_mapping.rb', line 614

def to_s
  '<Twilio::REST::Insights::V3PageMetadata>';
end