Class: ApiGuides::Views::Document
- Inherits:
-
Object
- Object
- ApiGuides::Views::Document
- Includes:
- ApiGuides::ViewHelper
- Defined in:
- lib/api_guides/views/document.rb
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(document) ⇒ Document
constructor
A new instance of Document.
- #sections ⇒ Object
- #title ⇒ Object
Methods included from ApiGuides::ViewHelper
Constructor Details
#initialize(document) ⇒ Document
Returns a new instance of Document.
8 9 10 |
# File 'lib/api_guides/views/document.rb', line 8 def initialize(document) @document = document end |
Instance Method Details
#id ⇒ Object
12 13 14 |
# File 'lib/api_guides/views/document.rb', line 12 def id anchorize "d-#{@document.title}" end |
#sections ⇒ Object
20 21 22 |
# File 'lib/api_guides/views/document.rb', line 20 def sections @document.sections.map { |s| Section.new(s) } end |
#title ⇒ Object
16 17 18 |
# File 'lib/api_guides/views/document.rb', line 16 def title @document.title end |