Class: Notion::Pages

Inherits:
Object
  • Object
show all
Includes:
RequestClient
Defined in:
lib/notion-sdk-ruby/resources/pages.rb

Instance Method Summary collapse

Methods included from RequestClient

#delete, #get, #patch, #post

Instance Method Details

#create(body) ⇒ Object


10
11
12
13
# File 'lib/notion-sdk-ruby/resources/pages.rb', line 10

def create(body)
  response = post("/v1/pages", body.to_json)
  Page.new(response.body)
end

#retrieve(id) ⇒ Object


5
6
7
8
# File 'lib/notion-sdk-ruby/resources/pages.rb', line 5

def retrieve(id)
  response = get("/v1/pages/#{id}")
  Page.new(response.body)
end

#update(id, body) ⇒ Object


15
16
17
18
# File 'lib/notion-sdk-ruby/resources/pages.rb', line 15

def update(id, body)
  response = patch("/v1/pages/#{id}", body.to_json)
  Page.new(response.body)
end