Class: ABI::Function

Inherits:
Object
  • Object
show all
Defined in:
lib/abidoc/model.rb

Overview

class Constructor

Instance Method Summary collapse

Instance Method Details

#docObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/abidoc/model.rb', line 31

def doc
  ## note: text with markdown formatting
  buf = "function **#{@name}**"
  if @inputs.empty?
    buf << "()"
  else
    params = @inputs.map {|param| param.doc }
    buf << "(#{params.join(', ')})"
  end
  if @outputs.empty?
     ## do nothing
  else
    buf << ""
    params = @outputs.map {|param| param.doc }
    buf << "(#{params.join(', ')})"
  end
  buf
end