Class: JekyllNotion::AbstractNotionResource

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-notion/abstract_notion_resource.rb

Direct Known Subclasses

NotionDatabase, NotionPage

Instance Method Summary collapse

Constructor Details

#initialize(config:) ⇒ AbstractNotionResource

Returns a new instance of AbstractNotionResource.



5
6
7
8
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 5

def initialize(config:)
  @notion = Notion::Client.new
  @config = config
end

Instance Method Details

#collection_nameObject



22
23
24
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 22

def collection_name
  raise "Do not use the AbstractGenerator class. Implement the collection_name method in a subclass."
end

#configObject



10
11
12
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 10

def config
  @config || {}
end

#data_nameObject



26
27
28
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 26

def data_name
  raise "Do not use the AbstractGenerator class. Implement the data_name method in a subclass."
end

#fetchObject



18
19
20
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 18

def fetch
  raise "Do not use the AbstractNotionResource class. Implement the fetch method in a subclass."
end

#idObject



14
15
16
# File 'lib/jekyll-notion/abstract_notion_resource.rb', line 14

def id
  config["id"]
end