22: def parse
23: title = @source.at('title').inner_text
24: @package = title.split('.')[0..-2].join('.')
25: @classname = title.split('.')[-1].split(/\s/)[0]
26: @logger.debug "parse: #{@package} #{@classname}"
27: @source.search('td.summaryTableSignatureCol').each {|el|
28: next if el.at('td.summaryTableInheritanceCol') || !el.at('a')
29:
30: begin
31: method = {
32: :href => el.at('a')['href'],
33: :name => el.at('a').inner_text.strip,
34: :code => el.search('div:not(.summaryTableDescription)').inner_text.strip.gsub("\n", ' '),
35: }
36: if summary = el.at('div.summaryTableDescription')
37: s = summary.inner_text.strip.gsub("\n", ' ')
38: if s[0..0] == '[' && s[-1..-1] == ']'
39: method[:code] << " #{s}"
40: method[:code].strip!
41: else
42: method[:summary] = s
43: end
44: end
45: @methods << method
46: rescue NoMethodError => e
47: @logger.debug e.message
48: @logger.debug el.inner_text.strip.gsub("\n", ' ')
49: end
50: }
51: @logger.debug "parse: #{@methods.length} methods found"
52: end