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.



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

def initialize(options, docs, doc_structure, doc_coverage)
  self.docs = docs
  self.doc_structure = doc_structure
  self.doc_coverage = doc_coverage
  self.name = options.module_name
  self.author_name = options.author_name
  self.author_url = options.author_url
  self.host = SourceHost.create(options)
  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.



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

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.



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

def doc_coverage
  @doc_coverage
end

#doc_structureObject

Returns the value of attribute doc_structure.



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

def doc_structure
  @doc_structure
end

#docsObject

Returns the value of attribute docs.



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

def docs
  @docs
end

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
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