Class: Jazzy::SourceModule

Inherits:
Object
  • Object
show all
Defined in:
lib/jazzy/source_module.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, docs, doc_structure, doc_coverage) ⇒ SourceModule

Returns a new instance of SourceModule.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jazzy/source_module.rb', line 19

def initialize(options, docs, doc_structure, doc_coverage)
  self.docs = docs
  self.root_path = options.source_directory
  self.doc_structure = doc_structure
  self.doc_coverage = doc_coverage
  self.name = options.module_name
  self.author_name = options.author_name
  self.github_url = options.github_url
  self.github_file_prefix = options.github_file_prefix
  self.author_url = options.author_url
  return unless options.dash_url
  self.dash_url =
    "dash-feed://#{ERB::Util.url_encode(options.dash_url.to_s)}"
end

Instance Attribute Details

#author_nameObject

Returns the value of attribute author_name.



13
14
15
# File 'lib/jazzy/source_module.rb', line 13

def author_name
  @author_name
end

#author_urlObject

Returns the value of attribute author_url.



16
17
18
# File 'lib/jazzy/source_module.rb', line 16

def author_url
  @author_url
end

#dash_urlObject

Returns the value of attribute dash_url.



17
18
19
# File 'lib/jazzy/source_module.rb', line 17

def dash_url
  @dash_url
end

#doc_coverageObject

Returns the value of attribute doc_coverage.



11
12
13
# File 'lib/jazzy/source_module.rb', line 11

def doc_coverage
  @doc_coverage
end

#doc_structureObject

Returns the value of attribute doc_structure.



12
13
14
# File 'lib/jazzy/source_module.rb', line 12

def doc_structure
  @doc_structure
end

#docsObject

Returns the value of attribute docs.



10
11
12
# File 'lib/jazzy/source_module.rb', line 10

def docs
  @docs
end

#github_file_prefixObject

Returns the value of attribute github_file_prefix.



15
16
17
# File 'lib/jazzy/source_module.rb', line 15

def github_file_prefix
  @github_file_prefix
end

#github_urlObject

Returns the value of attribute github_url.



14
15
16
# File 'lib/jazzy/source_module.rb', line 14

def github_url
  @github_url
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/jazzy/source_module.rb', line 8

def name
  @name
end

#root_pathObject

Returns the value of attribute root_path.



9
10
11
# File 'lib/jazzy/source_module.rb', line 9

def root_path
  @root_path
end

Instance Method Details

#all_declarationsObject



34
35
36
37
38
39
40
41
42
# File 'lib/jazzy/source_module.rb', line 34

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