Class: Sprites::Collection
- Inherits:
-
Object
- Object
- Sprites::Collection
- Defined in:
- lib/sprites/collection.rb
Overview
Paginated collection of sprites.
Instance Attribute Summary collapse
-
#next_continuation_token ⇒ String?
readonly
Token for fetching the next page.
-
#sprites ⇒ Array<Sprite>
readonly
Sprites in this page.
Instance Method Summary collapse
-
#has_more? ⇒ Boolean
Check if more pages are available.
-
#initialize(sprites:, has_more:, next_continuation_token:) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(sprites:, has_more:, next_continuation_token:) ⇒ Collection
Returns a new instance of Collection.
12 13 14 15 16 |
# File 'lib/sprites/collection.rb', line 12 def initialize(sprites:, has_more:, next_continuation_token:) @sprites = sprites @has_more = has_more @next_continuation_token = next_continuation_token end |
Instance Attribute Details
#next_continuation_token ⇒ String? (readonly)
Returns token for fetching the next page.
10 11 12 |
# File 'lib/sprites/collection.rb', line 10 def next_continuation_token @next_continuation_token end |
#sprites ⇒ Array<Sprite> (readonly)
Returns sprites in this page.
7 8 9 |
# File 'lib/sprites/collection.rb', line 7 def sprites @sprites end |
Instance Method Details
#has_more? ⇒ Boolean
Check if more pages are available.
21 22 23 |
# File 'lib/sprites/collection.rb', line 21 def has_more? @has_more && !@next_continuation_token.nil? end |