Class: Quaderno::Collection

Inherits:
Array
  • Object
show all
Includes:
Helpers::RateLimit
Defined in:
lib/quaderno-ruby/collection.rb

Instance Method Summary collapse

Methods included from Helpers::RateLimit

#rate_limit_info, #rate_limit_info=

Instance Method Details

#collection_type=(collection_type) ⇒ Object



8
9
10
# File 'lib/quaderno-ruby/collection.rb', line 8

def collection_type=(collection_type)
  @collection_type = collection_type
end

#has_more=(has_more_response) ⇒ Object



12
13
14
# File 'lib/quaderno-ruby/collection.rb', line 12

def has_more=(has_more_response)
  @has_more = has_more_response
end

#has_more?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/quaderno-ruby/collection.rb', line 20

def has_more?
  @has_more == 'true'
end

#next_pageObject



24
25
26
27
# File 'lib/quaderno-ruby/collection.rb', line 24

def next_page
  return Quaderno::Collection.new unless has_more?
  @collection_type.all_from_url(@next_page_url, @request_options)
end

#next_page_url=(next_page_url) ⇒ Object



16
17
18
# File 'lib/quaderno-ruby/collection.rb', line 16

def next_page_url=(next_page_url)
  @next_page_url = next_page_url
end

#request_options=(options) ⇒ Object



4
5
6
# File 'lib/quaderno-ruby/collection.rb', line 4

def request_options=(options)
  @request_options = options
end