Class: ApiGuides::Views::Document

Inherits:
Object
  • Object
show all
Includes:
ApiGuides::ViewHelper
Defined in:
lib/api_guides/views/document.rb

Instance Method Summary collapse

Methods included from ApiGuides::ViewHelper

#anchorize

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

#idObject



12
13
14
# File 'lib/api_guides/views/document.rb', line 12

def id
  anchorize "d-#{@document.title}"
end

#sectionsObject



20
21
22
# File 'lib/api_guides/views/document.rb', line 20

def sections
  @document.sections.map { |s| Section.new(s) }
end

#titleObject



16
17
18
# File 'lib/api_guides/views/document.rb', line 16

def title
  @document.title
end