Class: Mizuho::Chapter
- Inherits:
-
Object
- Object
- Mizuho::Chapter
- Defined in:
- lib/mizuho/chapter.rb
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#heading ⇒ Object
This may be nil, indicating that this chapter is the preamble.
Instance Method Summary collapse
- #anchor ⇒ Object
- #anchor_id ⇒ Object
- #basename ⇒ Object
- #is_preamble? ⇒ Boolean
- #plain_title ⇒ Object
- #title ⇒ Object
- #title_without_numbers ⇒ Object
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
7 8 9 |
# File 'lib/mizuho/chapter.rb', line 7 def contents @contents end |
#filename ⇒ Object
Returns the value of attribute filename.
6 7 8 |
# File 'lib/mizuho/chapter.rb', line 6 def filename @filename end |
#heading ⇒ Object
This may be nil, indicating that this chapter is the preamble.
5 6 7 |
# File 'lib/mizuho/chapter.rb', line 5 def heading @heading end |
Instance Method Details
#anchor ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/mizuho/chapter.rb', line 41 def anchor if @heading return @heading.anchor else return nil end end |
#anchor_id ⇒ Object
49 50 51 |
# File 'lib/mizuho/chapter.rb', line 49 def anchor_id return anchor.sub(/^#/, '') end |
#basename ⇒ Object
37 38 39 |
# File 'lib/mizuho/chapter.rb', line 37 def basename return File.basename(filename) end |
#is_preamble? ⇒ Boolean
9 10 11 |
# File 'lib/mizuho/chapter.rb', line 9 def is_preamble? return heading.nil? end |
#plain_title ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/mizuho/chapter.rb', line 29 def plain_title if @heading return @heading.plain_title else return nil end end |
#title ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/mizuho/chapter.rb', line 13 def title if @heading return @heading.title else return nil end end |
#title_without_numbers ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/mizuho/chapter.rb', line 21 def title_without_numbers if @heading return @heading.title_without_numbers else return nil end end |