<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. Singleton methods

self.new(expression) → LinkToPageBlock

self.new creates a LinkToPageBlock object using a page_id of database_id.

b = LinkToPageBlock.new page_id: "c01166c613ae45cbb96818b4ef2f5a77"
b.block_json
# => {"type"=>"link_to_page", "object"=>"block", "link_to_page"=>{"type"=>"page_id", "page_id"=>"c01166c613ae45cbb96818b4ef2f5a77"}}

↑ Table of Contents

2. Instance methods

database_id → String

database_id returns the database_id for LinkToPageBlock.

b = LinkToPageBlock.new database_id: "c7697137d49f49c2bbcdd6a665c4f921"
# => {"type"=>"link_to_page", "object"=>"block", "link_to_page"=>{"type"=>"database_id", "database_id"=>"c7697137d49f49c2bbcdd6a665c4f921"}}

↑ Table of Contents

page_id → String

page_id returns the page_id for LinkToPageBlock.

b = LinkToPageBlock.new page_id: "c01166c613ae45cbb96818b4ef2f5a77"
# => {"type"=>"link_to_page", "object"=>"block", "link_to_page"=>{"type"=>"page_id", "page_id"=>"c01166c613ae45cbb96818b4ef2f5a77"}}

↑ Table of Contents