class NotionOrbit::NotionObjects::Blocks
Attributes
blocks[RW]
Public Class Methods
new(raw_blocks, notion_api_key, indentation: 0)
click to toggle source
# File lib/notion_orbit/notion_objects/blocks.rb, line 8 def initialize(raw_blocks, notion_api_key, indentation: 0) @blocks = raw_blocks.map{ |raw_block| Block.new_from_raw_block(raw_block, notion_api_key, indentation: indentation) } @notion_api_key = notion_api_key @indentation = indentation end
Public Instance Methods
to_markdown()
click to toggle source
# File lib/notion_orbit/notion_objects/blocks.rb, line 14 def to_markdown @blocks.map { |block| " " * @indentation + block.to_markdown }.join("\n").rstrip.gsub("\n","\\n") end