Class: NotionRubyMapping::Page

Inherits:
Base
  • Object
show all
Defined in:
lib/notion_ruby_mapping/page.rb

Overview

Notion page object

Instance Attribute Summary

Attributes inherited from Base

#id, #json

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], #assign_property, #children, create_from_json, #icon, #initialize, #json_properties, #new_record?, #properties, #property_values_json, #reload, #restore_from_json, #save, #set_icon, #title, #update_json

Constructor Details

This class inherits a constructor from NotionRubyMapping::Base

Class Method Details

.find(id) ⇒ Object



6
7
8
# File 'lib/notion_ruby_mapping/page.rb', line 6

def self.find(id)
  NotionCache.instance.page id
end

Instance Method Details

#createNotionRubyMapping::Base



16
17
18
19
# File 'lib/notion_ruby_mapping/page.rb', line 16

def create
  @new_record = false
  update_json @nc.create_page_request(property_values_json)
end

#updateNotionRubyMapping::Base

Returns 46G.

Returns:



11
12
13
# File 'lib/notion_ruby_mapping/page.rb', line 11

def update
  update_json @nc.update_page_request(@id, property_values_json)
end