lib/parade/section.rb in parade-0.8.0 vs lib/parade/section.rb in parade-0.8.1
- old
+ new
@@ -23,9 +23,17 @@
# @return [String] the title of the section
def title
@title ? @title : (section ? section.title : "Section")
end
+ # @return [Array<String>] the name of all the parent sections. In this
+ # instance we are not interested in sections without names. These are
+ # the lowest level sections and are usually within a parent section that
+ # they are acurrately named.
+ def hierarchy
+ Array(@title) + (section ? section.hierarchy : [])
+ end
+
# @return [String] the description of the section
attr_accessor :description
# @return [Array<#slides>] returns an array of a Section objects or array
# of Slide objects.
\ No newline at end of file