Class: Notion::Api::PagesMethods
- Inherits:
-
Object
- Object
- Notion::Api::PagesMethods
- Includes:
- RequestClient
- Defined in:
- lib/notion-sdk-ruby/api/pages.rb
Instance Method Summary collapse
-
#create(body) ⇒ Notion::Page
Creates a new page in the specified database or as a child of an existing page.
-
#retrieve(id) ⇒ Notion::Page
Retrieves a Page object using the ID specified.
-
#update(id, body) ⇒ Notion::Page
Updates page property values for the specified page.
Instance Method Details
#create(body) ⇒ Notion::Page
Creates a new page in the specified database or as a child of an existing page. developers.notion.com/reference/post-page
20 21 22 23 |
# File 'lib/notion-sdk-ruby/api/pages.rb', line 20 def create(body) response = post("/v1/pages", body.to_json) Page.new(response.body) end |
#retrieve(id) ⇒ Notion::Page
Retrieves a Page object using the ID specified. developers.notion.com/reference/retrieve-a-page
10 11 12 13 |
# File 'lib/notion-sdk-ruby/api/pages.rb', line 10 def retrieve(id) response = get("/v1/pages/#{id}") Page.new(response.body) end |
#update(id, body) ⇒ Notion::Page
Updates page property values for the specified page. developers.notion.com/reference/patch-page
30 31 32 33 |
# File 'lib/notion-sdk-ruby/api/pages.rb', line 30 def update(id, body) response = patch("/v1/pages/#{id}", body.to_json) Page.new(response.body) end |