Module: NotionRb::Utils::Types

Included in:
Block, Parser
Defined in:
lib/notion_rb/utils/types.rb

Constant Summary collapse

TYPE_MAPPER =
{
  'collection' => :collection,
  'collection_view_page' => :collection_view,
  'column' => :base,
  'column_list' => :base,
  'divider' => :base,
  'copy_indicator' => :null,
  'table_of_contents' => :null,
  'factory' => :null,
  'page' => :base,
  'header' => :base,
  'bulleted_list' => :base,
  'numbered_list' => :base,
  'toggle' => :base,
  'sub_header' => :base,
  'sub_sub_header' => :base,
  'quote' => :base,
  'text' => :base,
  'to_do' => :todo,
  'code' => :code,
  'image' => :image,
  'file' => :embed,
  'audio' => :embed,
  'drive' => :embed,
  'embed' => :embed,
  'bookmark' => :bookmark,
  'callout' => :callout
}.freeze

Instance Method Summary collapse

Instance Method Details

#select_parser(value) ⇒ Object



39
40
41
# File 'lib/notion_rb/utils/types.rb', line 39

def select_parser(value)
  TYPE_MAPPER[value]
end

#valid_block_type?(value) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/notion_rb/utils/types.rb', line 35

def valid_block_type?(value)
  TYPE_MAPPER.key?(value)
end