Class: Jazzy::SourceModule
- Inherits:
-
Object
- Object
- Jazzy::SourceModule
- Includes:
- Config::Mixin
- Defined in:
- lib/jazzy/source_module.rb
Overview
A cache of info that is common across all page templating, gathered from other parts of the program.
Instance Attribute Summary collapse
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#author_url ⇒ Object
Returns the value of attribute author_url.
-
#dash_feed_url ⇒ Object
Returns the value of attribute dash_feed_url.
-
#doc_coverage ⇒ Object
Returns the value of attribute doc_coverage.
-
#doc_structure ⇒ Object
Returns the value of attribute doc_structure.
-
#docs ⇒ Object
Returns the value of attribute docs.
-
#host ⇒ Object
Returns the value of attribute host.
-
#readme_title ⇒ Object
Returns the value of attribute readme_title.
Instance Method Summary collapse
- #all_declarations ⇒ Object
-
#initialize(docs, doc_structure, doc_coverage, docset_builder) ⇒ SourceModule
constructor
A new instance of SourceModule.
Methods included from Config::Mixin
Constructor Details
#initialize(docs, doc_structure, doc_coverage, docset_builder) ⇒ SourceModule
Returns a new instance of SourceModule.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jazzy/source_module.rb', line 24 def initialize(docs, doc_structure, doc_coverage, docset_builder) self.docs = docs self.doc_structure = doc_structure self.doc_coverage = doc_coverage title = config.readme_title || config.module_names.first self.readme_title = title.empty? ? 'Index' : title self. = config. self. = config. self.host = SourceHost.create(config) self.dash_feed_url = docset_builder.dash_feed_url end |
Instance Attribute Details
#author_name ⇒ Object
Returns the value of attribute author_name.
19 20 21 |
# File 'lib/jazzy/source_module.rb', line 19 def @author_name end |
#author_url ⇒ Object
Returns the value of attribute author_url.
20 21 22 |
# File 'lib/jazzy/source_module.rb', line 20 def @author_url end |
#dash_feed_url ⇒ Object
Returns the value of attribute dash_feed_url.
21 22 23 |
# File 'lib/jazzy/source_module.rb', line 21 def dash_feed_url @dash_feed_url end |
#doc_coverage ⇒ Object
Returns the value of attribute doc_coverage.
17 18 19 |
# File 'lib/jazzy/source_module.rb', line 17 def doc_coverage @doc_coverage end |
#doc_structure ⇒ Object
Returns the value of attribute doc_structure.
18 19 20 |
# File 'lib/jazzy/source_module.rb', line 18 def doc_structure @doc_structure end |
#docs ⇒ Object
Returns the value of attribute docs.
16 17 18 |
# File 'lib/jazzy/source_module.rb', line 16 def docs @docs end |
#host ⇒ Object
Returns the value of attribute host.
22 23 24 |
# File 'lib/jazzy/source_module.rb', line 22 def host @host end |
#readme_title ⇒ Object
Returns the value of attribute readme_title.
15 16 17 |
# File 'lib/jazzy/source_module.rb', line 15 def readme_title @readme_title end |
Instance Method Details
#all_declarations ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/jazzy/source_module.rb', line 36 def all_declarations all_declarations = [] visitor = lambda do |d| all_declarations.unshift(*d) d.map(&:children).each { |c| visitor[c] } end visitor[docs] all_declarations.reject { |doc| doc.name == 'index' } end |