Class: Twilio::REST::Verify::V2::ServiceContext::ApproveChallengePageMetadata

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



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb', line 174

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

#approve_challenge_pageObject (readonly)

Returns the value of attribute approve_challenge_page.



172
173
174
# File 'lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb', line 172

def approve_challenge_page
  @approve_challenge_page
end

Instance Method Details

#eachObject



190
191
192
193
194
# File 'lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb', line 190

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

#to_sObject



196
197
198
# File 'lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb', line 196

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