Class: Anydoc::Block

Inherits:
Data
  • Object
show all
Defined in:
lib/anydoc/document.rb,
sig/anydoc.rbs

Overview

One block-level piece of content.

Instance Attribute Summary collapse

Instance Attribute Details

#anchorString? (readonly)

Returns heading: stable anchor id, when the document targets this heading.

Returns:

  • (String, nil)

    heading: stable anchor id, when the document targets this heading.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#blocksArray<Block>? (readonly)

Returns block_quote.

Returns:

  • (Array<Block>, nil)

    block_quote.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#contentArray<Inline>? (readonly)

Returns heading, paragraph.

Returns:

  • (Array<Inline>, nil)

    heading, paragraph.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#kindSymbol (readonly)

:heading | :paragraph | :list | :table | :block_quote | :code_block | :rule

Returns:

  • (Symbol)


53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#langString? (readonly)

Returns code_block.

Returns:

  • (String, nil)

    code_block.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#levelInteger? (readonly)

Returns heading: 1-6.

Returns:

  • (Integer, nil)

    heading: 1-6.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#listList? (readonly)

Returns:



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#tableTable? (readonly)

Returns:



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end

#textString? (readonly)

Returns code_block.

Returns:

  • (String, nil)

    code_block.



53
54
55
56
# File 'lib/anydoc/document.rb', line 53

class Block < Data.define(
  :kind, :level, :anchor, :content, :list, :table, :blocks, :lang, :text
)
end