Last active
June 6, 2024 18:22
-
-
Save fsubal/12d0e7207a0076ba2636e67551c72dac to your computer and use it in GitHub Desktop.
Notion ActiveRecord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Notion | |
class Task < Database::Page | |
self.database_id = 'e383bcee-e0d8-4564-9c63-900d307abdb0' | |
def event_date | |
property('作成日時') #=> Notion::Database::Property | |
end | |
def assignees | |
property('担当者') #=> Array<Notion::Database::Property> | |
end | |
def status | |
property('ステータス') #=> Notion::Database::Property | |
end | |
def projects | |
property('関連するプロジェクト') #=> Array<Notion::Database::Page> | |
end | |
end | |
end | |
task = Notion::Task.find_by_page_id!('...') | |
task.body.search('h2 + ul > li') #=> Notion::RichText::Node | |
task.comments #=> Array<Notion::Database::Comment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment