Class: Glyph::Header
Overview
This class is used to model bookmark headers
Instance Attribute Summary collapse
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Attributes inherited from Bookmark
Instance Method Summary collapse
-
#initialize(hash) ⇒ Header
constructor
Initializes the bookmark from a hash.
-
#toc? ⇒ Boolean
Returns true if the header is displayed in the Table of contents.
Methods inherited from Bookmark
Constructor Details
#initialize(hash) ⇒ Header
Initializes the bookmark from a hash. The header hash takes two additional options: :level (the header level within the document), :toc (whether the header should appear in the Table of Contents or not)
81 82 83 84 85 |
# File 'lib/glyph/bookmark.rb', line 81 def initialize(hash) super(hash) @level = hash[:level] @toc = hash[:toc] end |
Instance Attribute Details
#level ⇒ Object (readonly)
Returns the value of attribute level.
77 78 79 |
# File 'lib/glyph/bookmark.rb', line 77 def level @level end |
Instance Method Details
#toc? ⇒ Boolean
Returns true if the header is displayed in the Table of contents
88 89 90 |
# File 'lib/glyph/bookmark.rb', line 88 def toc? @toc end |