Class: Twilio::REST::Insights::V3::MetadataPageMetadata

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

Returns a new instance of MetadataPageMetadata.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/twilio-ruby/rest/insights/v3/metadata.rb', line 120

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

#metadata_pageObject (readonly)

Returns the value of attribute metadata_page.



118
119
120
# File 'lib/twilio-ruby/rest/insights/v3/metadata.rb', line 118

def 
  @metadata_page
end

Instance Method Details

#eachObject



136
137
138
139
140
# File 'lib/twilio-ruby/rest/insights/v3/metadata.rb', line 136

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

#to_sObject



142
143
144
# File 'lib/twilio-ruby/rest/insights/v3/metadata.rb', line 142

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