Class: NotionRails::Page
- Inherits:
-
Object
- Object
- NotionRails::Page
- Includes:
- Renderers
- Defined in:
- lib/notion_rails/page.rb
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #formatted_blocks(options = {}) ⇒ Object
-
#initialize(base_page, base_blocks) ⇒ Page
constructor
A new instance of Page.
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
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks.
7 8 9 |
# File 'lib/notion_rails/page.rb', line 7 def blocks @blocks end |
#metadata ⇒ Object (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( = {}) @blocks.map { |block| block.render() } end |