Class: Coradoc::AsciiDoc::Model::CommentLine

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/asciidoc/model/comment_line.rb

Overview

Single-line comment element for AsciiDoc documents.

Comment lines start with double slash (//) and are not included in the final document output.

Examples:

Create a comment line

comment = Coradoc::AsciiDoc::Model::CommentLine.new
comment.text = "This is a comment"
comment.to_adoc # => "// This is a comment\n"

See Also:

Instance Attribute Summary collapse

Attributes inherited from Base

#id

Method Summary

Methods inherited from Base

#block_level?, #inline?, #serialize_content, #simplify_block_content, #to_adoc, #to_h, visit, #visit

Instance Attribute Details

#line_breakString (readonly)

Returns Line break character (default: “n”).

Returns:

  • (String)

    Line break character (default: “n”)



24
25
26
27
# File 'lib/coradoc/asciidoc/model/comment_line.rb', line 24

class CommentLine < Base
  attribute :text, :string
  attribute :line_break, :string, default: -> { "\n" }
end

#textString (readonly)

Returns The comment text.

Returns:

  • (String)

    The comment text



24
25
26
27
# File 'lib/coradoc/asciidoc/model/comment_line.rb', line 24

class CommentLine < Base
  attribute :text, :string
  attribute :line_break, :string, default: -> { "\n" }
end