Class: Exa::Resources::WebsetCollection
- Inherits:
-
Struct
- Object
- Struct
- Exa::Resources::WebsetCollection
- Defined in:
- lib/exa/resources/webset_collection.rb
Overview
Represents a paginated list of websets from the Exa API
This class wraps the JSON response from the GET /websets/v0/websets endpoint and provides pagination support.
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#has_more ⇒ Object
Returns the value of attribute has_more.
-
#next_cursor ⇒ Object
Returns the value of attribute next_cursor.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(data:, has_more: false, next_cursor: nil) ⇒ WebsetCollection
constructor
A new instance of WebsetCollection.
- #to_h ⇒ Object
Constructor Details
#initialize(data:, has_more: false, next_cursor: nil) ⇒ WebsetCollection
Returns a new instance of WebsetCollection.
15 16 17 18 |
# File 'lib/exa/resources/webset_collection.rb', line 15 def initialize(data:, has_more: false, next_cursor: nil) super freeze end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
9 10 11 |
# File 'lib/exa/resources/webset_collection.rb', line 9 def data @data end |
#has_more ⇒ Object
Returns the value of attribute has_more
9 10 11 |
# File 'lib/exa/resources/webset_collection.rb', line 9 def has_more @has_more end |
#next_cursor ⇒ Object
Returns the value of attribute next_cursor
9 10 11 |
# File 'lib/exa/resources/webset_collection.rb', line 9 def next_cursor @next_cursor end |
Instance Method Details
#empty? ⇒ Boolean
20 21 22 |
# File 'lib/exa/resources/webset_collection.rb', line 20 def empty? data.empty? end |
#to_h ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/exa/resources/webset_collection.rb', line 24 def to_h { data: data, has_more: has_more, next_cursor: next_cursor } end |