Class: Twilio::REST::Pricing::V2::VoicePageMetadata
- Inherits:
-
Twilio::REST::PageMetadata
- Object
- Twilio::REST::PageMetadata
- Twilio::REST::Pricing::V2::VoicePageMetadata
- Defined in:
- lib/twilio-ruby/rest/pricing/v2/voice.rb
Constant Summary
Constants inherited from Twilio::REST::PageMetadata
Twilio::REST::PageMetadata::META_KEYS
Instance Attribute Summary collapse
-
#voice_page ⇒ Object
readonly
Returns the value of attribute voice_page.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(version, response, solution, limit) ⇒ VoicePageMetadata
constructor
A new instance of VoicePageMetadata.
- #to_s ⇒ Object
Methods inherited from Twilio::REST::PageMetadata
#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response
Constructor Details
#initialize(version, response, solution, limit) ⇒ VoicePageMetadata
Returns a new instance of VoicePageMetadata.
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 104 def initialize(version, response, solution, limit) super(version, response) @voice_page = [] @limit = limit key = get_key(response.body) records = 0 while( limit != :unset && records < limit ) @voice_page << VoiceListResponse.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
#voice_page ⇒ Object (readonly)
Returns the value of attribute voice_page.
102 103 104 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 102 def voice_page @voice_page end |
Instance Method Details
#each ⇒ Object
120 121 122 123 124 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 120 def each @voice_page.each do |record| yield record end end |
#to_s ⇒ Object
126 127 128 |
# File 'lib/twilio-ruby/rest/pricing/v2/voice.rb', line 126 def to_s '<Twilio::REST::Pricing::V2PageMetadata>'; end |