Class: Coradoc::AsciiDoc::Model::Inline::Anchor
Overview
Anchor inline element for creating cross-reference targets in AsciiDoc documents.
Anchors create reference points that can be linked to from other parts of the document using cross-references.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
The anchor identifier.
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from Base
#block_level?, #inline?, #serialize_content, #simplify_block_content, #to_adoc, #to_h, visit, #visit
Instance Attribute Details
#id ⇒ String (readonly)
Returns The anchor identifier.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/coradoc/asciidoc/model/inline/anchor.rb', line 27 class Anchor < Base attribute :id, :string def validate errors = super return unless id.nil? || id.empty? errors << Lutaml::Model::Error.new('ID cannot be nil or empty for Anchor') end end |
Instance Method Details
#validate ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/coradoc/asciidoc/model/inline/anchor.rb', line 30 def validate errors = super return unless id.nil? || id.empty? errors << Lutaml::Model::Error.new('ID cannot be nil or empty for Anchor') end |