Class: Mizuho::Chapter

Inherits:
Object
  • Object
show all
Defined in:
lib/mizuho/chapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentsObject

Returns the value of attribute contents.



7
8
9
# File 'lib/mizuho/chapter.rb', line 7

def contents
  @contents
end

#filenameObject

Returns the value of attribute filename.



6
7
8
# File 'lib/mizuho/chapter.rb', line 6

def filename
  @filename
end

#headingObject

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

#anchorObject



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_idObject



49
50
51
# File 'lib/mizuho/chapter.rb', line 49

def anchor_id
  return anchor.sub(/^#/, '')
end

#basenameObject



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_titleObject



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

#titleObject



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_numbersObject



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