Class: NotionToMd::Blocks::BulletedListBlock
- Defined in:
- lib/notion_to_md/blocks/bulleted_list_block.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Block
Instance Method Summary collapse
-
#initialize(children: []) ⇒ BulletedListBlock
constructor
A new instance of BulletedListBlock.
- #newline ⇒ Object
-
#to_md(tab_width: 0) ⇒ Object
Parameters: tab_width:: The number of tabs used to indent the block.
- #type ⇒ Object
Constructor Details
#initialize(children: []) ⇒ BulletedListBlock
Returns a new instance of BulletedListBlock.
6 7 8 |
# File 'lib/notion_to_md/blocks/bulleted_list_block.rb', line 6 def initialize(children: []) @children = children end |
Instance Method Details
#newline ⇒ Object
29 30 31 |
# File 'lib/notion_to_md/blocks/bulleted_list_block.rb', line 29 def newline "\n" end |
#to_md(tab_width: 0) ⇒ Object
Parameters:
- tab_width
-
The number of tabs used to indent the block.
Returns
The current block (and its children) converted to a markdown string.
17 18 19 20 21 22 23 |
# File 'lib/notion_to_md/blocks/bulleted_list_block.rb', line 17 def to_md(tab_width: 0) if tab_width.zero? build_nested_blocks(tab_width) + newline else build_nested_blocks(tab_width) end end |
#type ⇒ Object
25 26 27 |
# File 'lib/notion_to_md/blocks/bulleted_list_block.rb', line 25 def type 'bulleted_list' end |