Class: NotionRails::Page

Inherits:
Object
  • Object
show all
Includes:
Renderers
Defined in:
lib/notion_rails/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Renderers

#annotation_to_css_class, #render_bulleted_list_item, #render_callout, #render_code, #render_date, #render_heading_1, #render_heading_2, #render_heading_3, #render_image, #render_list_items, #render_numbered_list_item, #render_paragraph, #render_quote, #render_title, #render_video, #text_renderer

Constructor Details

#initialize(base_page, base_blocks) ⇒ Page

Returns a new instance of Page.



13
14
15
16
# File 'lib/notion_rails/page.rb', line 13

def initialize(base_page, base_blocks)
  @metadata = base_page
  @blocks = base_blocks
end

Instance Attribute Details

#blocksObject (readonly)

Returns the value of attribute blocks.



7
8
9
# File 'lib/notion_rails/page.rb', line 7

def blocks
  @blocks
end

#metadataObject (readonly)

Returns the value of attribute metadata.



7
8
9
# File 'lib/notion_rails/page.rb', line 7

def 
  @metadata
end

Instance Method Details

#formatted_blocks(options = {}) ⇒ Object



18
19
20
# File 'lib/notion_rails/page.rb', line 18

def formatted_blocks(options = {})
  @blocks.map { |block| block.render(options) }
end