Class: JsDuck::Process::NoDoc

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/process/no_doc.rb

Overview

Reports missing documentation

Instance Method Summary collapse

Constructor Details

#initialize(relations) ⇒ NoDoc

Returns a new instance of NoDoc.



9
10
11
# File 'lib/jsduck/process/no_doc.rb', line 9

def initialize(relations)
  @relations = relations
end

Instance Method Details

#process_all!Object

Prints warning for each class or public member with no name



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/jsduck/process/no_doc.rb', line 14

def process_all!
  @relations.each do |cls|

    if cls[:doc] == ""
      warn(:class, "No documentation for #{cls[:name]}", cls)
    end

    cls.all_local_members.each do |member|
      if !member[:hide] && !JsDuck::Class.constructor?(member)
        if member[:doc] == ""
          warn(:member, "No documentation for #{member[:owner]}##{member[:name]}", member)
        end

        (member[:params] || []).each do |p|
          if p[:doc] == ""
            warn(:param, "No documentation for parameter #{p[:name]} of #{member[:owner]}##{member[:name]}", member)
          end
        end

      end
    end

  end
end