Class: KillBillClient::Model::Resources

Inherits:
Array
  • Object
show all
Defined in:
lib/killbill_client/models/resources.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clazzObject (readonly)

Returns the value of attribute clazz.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def clazz
  @clazz
end

#etagObject (readonly)

Returns the value of attribute etag.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def etag
  @etag
end

#pagination_max_nb_recordsObject (readonly)

Returns the value of attribute pagination_max_nb_records.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def pagination_max_nb_records
  @pagination_max_nb_records
end

#pagination_next_pageObject (readonly)

Returns the value of attribute pagination_next_page.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def pagination_next_page
  @pagination_next_page
end

#pagination_total_nb_recordsObject (readonly)

Returns the value of attribute pagination_total_nb_records.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def pagination_total_nb_records
  @pagination_total_nb_records
end

#session_idObject (readonly)

Returns the value of attribute session_id.



5
6
7
# File 'lib/killbill_client/models/resources.rb', line 5

def session_id
  @session_id
end

Instance Method Details

#each_in_batches(&block) ⇒ Object

Same as .each, but fetch remaining pages as we go



14
15
16
17
18
19
20
21
22
23
# File 'lib/killbill_client/models/resources.rb', line 14

def each_in_batches(&block)
  each(&block)

  # Non-pagination usecase or last page reached
  return if @pagination_next_page.nil?

  # Query the server for the next page
  resources = Resource.get(@pagination_next_page, {}, {}, @clazz)
  resources.each_in_batches(&block)
end