Class: Notion::List
- Inherits:
-
Object
- Object
- Notion::List
- Defined in:
- lib/notion-sdk-ruby/models/list.rb
Overview
The List object is an intermediate object that helps with pagination.
Instance Attribute Summary collapse
-
#data ⇒ Array<Notion::User>, ...
readonly
An array of endpoint-dependent objects.
-
#has_more ⇒ boolean
readonly
When the response includes the end of the list, false.
-
#next_cursor ⇒ nil, string
readonly
Used to retrieve the next page of results by passing the value as the start_cursor parameter to the same endpoint.
Instance Method Summary collapse
-
#initialize(response_body) ⇒ List
constructor
A new instance of List.
Constructor Details
#initialize(response_body) ⇒ List
Returns a new instance of List.
23 24 25 26 27 28 29 30 |
# File 'lib/notion-sdk-ruby/models/list.rb', line 23 def initialize(response_body) @data = response_body["results"].map do |d| get_model(d["object"]).new(d) end @next_cursor = response_body["next_cursor"] @has_more = response_body["has_more"] end |
Instance Attribute Details
#data ⇒ Array<Notion::User>, ... (readonly)
An array of endpoint-dependent objects
11 12 13 |
# File 'lib/notion-sdk-ruby/models/list.rb', line 11 def data @data end |
#has_more ⇒ boolean (readonly)
When the response includes the end of the list, false. Otherwise, true.
21 22 23 |
# File 'lib/notion-sdk-ruby/models/list.rb', line 21 def has_more @has_more end |
#next_cursor ⇒ nil, string (readonly)
Used to retrieve the next page of results by passing the value as the start_cursor parameter to the same endpoint.
17 18 19 |
# File 'lib/notion-sdk-ruby/models/list.rb', line 17 def next_cursor @next_cursor end |