Module: Docbook::Elements::Identifiable
- Included in:
- Acknowledgements, Address, Annotation, Answer, Appendix, Article, AudioObject, Bibliography, Bibliolist, Biblioref, BlockQuote, Book, Callout, CalloutList, Caution, Chapter, Co, Colophon, ComputerOutput, Danger, Dedication, Equation, Example, Figure, Footnote, FootnoteRef, GlossEntry, Glossary, ImageObject, Important, Index, IndexDiv, IndexEntry, InformalExample, InformalFigure, ItemizedList, LegalNotice, ListItem, Msg, MsgSet, Msgexplan, Note, OrderedList, Part, Phrase, Preface, Procedure, QandAEntry, QandASet, Question, Quotation, RefEntry, RefSect1, RefSect2, RefSect3, RefSection, Reference, Remark, Sect1, Sect2, Sect3, Sect4, Sect5, Section, Set, SetIndex, SideBar, Simplesect, Step, Table, TextObject, Tip, Toc, TocDiv, TocEntry, Topic, UserInput, VariableList, VideoObject, Warning
- Defined in:
- lib/docbook/elements/concerns/identifiable.rb
Overview
Elements with xml_id — overrides element_id to access xml_id directly. DocbookElement provides element_id using protocol methods. This concern optimizes for elements that always have xml_id declared.
Instance Method Summary collapse
Instance Method Details
#element_id ⇒ Object
9 10 11 12 |
# File 'lib/docbook/elements/concerns/identifiable.rb', line 9 def element_id id = xml_id id && !id.to_s.empty? ? id.to_s : "elem-#{object_id}" end |