Class: NotionRubyMapping::Database
- Inherits:
-
Base
- Object
- Base
- NotionRubyMapping::Database
show all
- Defined in:
- lib/notion_ruby_mapping/database.rb
Overview
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
Class Method Details
.find(id) ⇒ Object
6
7
8
|
# File 'lib/notion_ruby_mapping/database.rb', line 6
def self.find(id)
NotionCache.instance.database id
end
|
Instance Method Details
23
24
25
|
# File 'lib/notion_ruby_mapping/database.rb', line 23
def create_child_page(*assign)
Page.new assign: assign, parent: {"database_id" => @id}
end
|
#query_database(query = Query.new) ⇒ Object
11
12
13
14
|
# File 'lib/notion_ruby_mapping/database.rb', line 11
def query_database(query = Query.new)
response = @nc.database_query @id, query
List.new json: response, database: self, query: query
end
|
17
18
19
|
# File 'lib/notion_ruby_mapping/database.rb', line 17
def update
update_json @nc.update_database_request(@id, property_values_json)
end
|