Class: Twilio::REST::Oauth::V1::AuthorizePageMetadata

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

Returns a new instance of AuthorizePageMetadata.



154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 154

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

#authorize_pageObject (readonly)

Returns the value of attribute authorize_page.



152
153
154
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 152

def authorize_page
  @authorize_page
end

Instance Method Details

#eachObject



170
171
172
173
174
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 170

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

#to_sObject



176
177
178
# File 'lib/twilio-ruby/rest/oauth/v1/authorize.rb', line 176

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