<aside> 👉 Links (Block base class)

Page

BookmarkBlock

CodeBlock

EmbedBlock

Heading2Block

LinkToPageBlock

QuoteBlock

ToDoBlock

ToggleHeading3Block

Database

BreadcrumbBlock

ColumnBlock

EquationBlock

Heading3Block

NumberedListItemBlock

SyncedBlock

ToggleBlock

VideoBlock

List

BulletedListItemBlock

ColumnListBlock

FileBlock

ImageBlock

ParagraphBlock

TableOfContentsBlock

ToggleHeading1Block

Block

CalloutBlock

DividerBlock

Heading1Block

LinkPreviewBlock

PdfBlock

TemplateBlock

ToggleHeading2Block

Notion Ruby Mapping Public API Reference

</aside>

<aside> ℹī¸ ↑ Table of Contents

</aside>

1. Instance methods

each { |item| ... } → self

each → Enumerator

db.query_database and other API list results returns a List object. The list object is an Enumerable object, so usually combines with .each method. Each Page or Block object is automatically mapped to a Ruby object when passed to a Ruby block.

Notion API returns only the first page-size objects. The default page-size of this library is 100. The page-size can be changed in Query object. Since the above .each method is supported for paging, it will automatically execute API call that obtain the following page-size objects when you used the first page-size objects. Users do not have to worry about paging.

db.query_database(query).each do |page|
  # exec some methods for a page object
end

↑ Table of Contents