Class: Docgen::ExtendedJavaDoc

Inherits:
JavaDoc
  • Object
show all
Defined in:
lib/docgen/cli.rb

Overview

class : ExtendedJavaDoc

An extension to JavaDoc to look for our specific JavaDoc markup

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeExtendedJavaDoc

initialize()

Constructor



20
21
22
23
24
25
26
27
28
# File 'lib/docgen/cli.rb', line 20

def initialize()
  
  super()
  
  @tableDescription = ""
  @fieldDescriptions = {}
  @relatesTo = []
  
end

Instance Attribute Details

#fieldDescriptionsObject (readonly)

The hash of descriptions for each field



31
32
33
# File 'lib/docgen/cli.rb', line 31

def fieldDescriptions
  @fieldDescriptions
end

#relatesToObject (readonly)

The array of tables this table relates to



32
33
34
# File 'lib/docgen/cli.rb', line 32

def relatesTo
  @relatesTo
end

#tableDescriptionObject (readonly)

The table description string



30
31
32
# File 'lib/docgen/cli.rb', line 30

def tableDescription
  @tableDescription
end

Instance Method Details

#add_to_tag(key, text) ⇒ Object

add_to_tag( key, text )

key - The JavaDoc key text - The text associated with the key

An override of the JavaDoc handler to look for our markup



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/docgen/cli.rb', line 41

def add_to_tag( key, text )
  
  # Strip any whitespace off the text
  
  text.strip!
  
  if ( key == "@desc" )
  
    # Add to the description any @desc data
  
    @tableDescription += text
  
  elsif ( key == "@field" )
  
    # Parse any @field description data
  
    text =~ /(.*?)\s/
    field = $1
  
    text.sub!( /^#{field}\s*/, "" )
  
    @fieldDescriptions[ field.downcase.strip ] = text
  
  elsif ( key == "@relates_to" )

    # Parse any @relates_to data
  
    @relatesTo.push( text )
  
  end
  
end