Class: NotionCf::PageResource
- Defined in:
- lib/notion_cf/page_resource.rb
Overview
PageResource class
Constant Summary
Constants inherited from Resource
Instance Attribute Summary
Attributes inherited from Resource
#attributes, #has_children, #id, #object, #parent, #type
Instance Method Summary collapse
- #block? ⇒ Boolean
- #deploy(client, parent_id) ⇒ Object
- #retrieve_additional_information(client, blueprints) ⇒ Object
Methods inherited from Resource
#blueprint, build_resource, #initialize
Constructor Details
This class inherits a constructor from NotionCf::Resource
Instance Method Details
#block? ⇒ Boolean
6 7 8 |
# File 'lib/notion_cf/page_resource.rb', line 6 def block? false end |
#deploy(client, parent_id) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/notion_cf/page_resource.rb', line 10 def deploy(client, parent_id) unless @id.nil? update(client) return end create(client, parent_id) end |
#retrieve_additional_information(client, blueprints) ⇒ Object
18 19 20 21 22 |
# File 'lib/notion_cf/page_resource.rb', line 18 def retrieve_additional_information(client, blueprints) page_detail = client.page(page_id: @id) parent = blueprints.detect { |h| h[:id] == @id } parent[:child_page].merge!(page_detail) end |