<aside> 👉 Links (Controller base class)

DiscussionThread

NotionCache

PropertyCache

Query

RichTextArray

Notion Ruby Mapping Public API Reference

</aside>

<aside> ℹī¸ ↑ Table of Contents

</aside>

1. Singleton methods

self.instance → NotionCache

NotionCache class is a singleton class. NotionCache.instance creates a NotionCache object or retrieve an existing Notion Cache object.

NotionCache.instance
# => #<NotionRubyMapping::NotionCache:...> # created or existing NotionCache object

↑ Table of Contents

2. Instance methods

create_client(notion_token, wait: 0.1)

Please create a client (notion-ruby-client) before you use the following class.

NotionCache.instance.create_client "secret_XXXXXXXXXXXXXXXXXXXX" # write directly
NotionCache.instance.create_client ENV["NOTION_API_TOKEN"], wait: 0.1 # token from environment and short wait

↑ Table of Contents

hex_id(id)

hex_id returns XXX_id without “-”

NotionCache.instance.hex_id "0a58761e-f3b4-429f-b86e-0ad9ff815fe1"
# => "0a58761ef3b4429fb86e0ad9ff815fe1"

↑ Table of Contents