Method: UCD::Formatter::Graphviz#format_method

Defined in:
lib/ucd/formatter/graphviz.rb

#format_method(node) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/ucd/formatter/graphviz.rb', line 63

def format_method(node)
  symbol = ACCESS_SYMBOLS[node.access]
  result = "#{symbol} #{node.name}"
  arguments = node.arguments.map do |argument|
    "#{argument.name}#{" : #{argument.type}" if argument.type}"
  end.join(", ") if node.arguments

  result << "(#{arguments})"
  result << " : #{node.type}" if node.type
  result = "<U>#{result}</U>" if node.static
  result = "<I>#{result}</I>" if node.abstract

  result
end