diff options
Diffstat (limited to 'uml')
| -rw-r--r-- | uml/Makefile | 10 | ||||
| -rw-r--r-- | uml/api.dot | 13 | ||||
| -rw-r--r-- | uml/api.lua | 29 | ||||
| -rw-r--r-- | uml/api.png | bin | 0 -> 25676 bytes |
4 files changed, 52 insertions, 0 deletions
diff --git a/uml/Makefile b/uml/Makefile new file mode 100644 index 0000000..219141c --- /dev/null +++ b/uml/Makefile @@ -0,0 +1,10 @@ + +api.png: api.dot + dot -T png -o api.png api.dot + +api.dot: api.lua + coat2dot api > api.dot + perl -i.bak -pe "s/_method/method/g" api.dot + +clean: + rm *.bak *.dot *.png
\ No newline at end of file diff --git a/uml/api.dot b/uml/api.dot new file mode 100644 index 0000000..4d2a3dc --- /dev/null +++ b/uml/api.dot @@ -0,0 +1,13 @@ +digraph { + + node [shape=record]; + + "Method" + [label="{\N|authentication : boolean\lbase_url : string\ldescription : string\lexpected : table<number>\lformat : table<string>\lmethod : string\loptional : table<string>\lpath : string\lrequired : table<string>\l}"]; + + "API" + [label="{\N|authentication : boolean\lauthority : string\lbase_url : string\ldescription : string\lformat : table<string>\lmeta : table<string,string>\lmethods : table<string,Method>\lname : string\lversion : string\l}"]; + "API" -> "Method" // attr isa table<string,Method> + [label = "methods", arrowhead = none, arrowtail = odiamond]; + +} diff --git a/uml/api.lua b/uml/api.lua new file mode 100644 index 0000000..16f187a --- /dev/null +++ b/uml/api.lua @@ -0,0 +1,29 @@ + +require 'Coat' +require 'Coat.Types' + +class 'Method' + +has._method = { is = 'ro', isa = 'string', required = true } +has.path = { is = 'ro', isa = 'string', required = true } +has.expected = { is = 'ro', isa = 'table<number>' } +has.required = { is = 'ro', isa = 'table<string>' } +has.optional = { is = 'ro', isa = 'table<string>' } +has.base_url = { is = 'ro', isa = 'string' } +has.description = { is = 'ro', isa = 'string' } +has.authentication = { is = 'ro', isa = 'boolean' } +has.format = { is = 'ro', isa = 'table<string>' } + + +class 'API' + +has.name = { is = 'ro', isa = 'string', required = true } +has.methods = { is = 'ro', isa = 'table<string,Method>', required = true } +has.base_url = { is = 'ro', isa = 'string' } +has.description = { is = 'ro', isa = 'string' } +has.authentication = { is = 'ro', isa = 'boolean' } +has.version = { is = 'ro', isa = 'string' } +has.authority = { is = 'ro', isa = 'string' } +has.format = { is = 'ro', isa = 'table<string>' } +has.meta = { is = 'ro', isa = 'table<string,string>' } + diff --git a/uml/api.png b/uml/api.png Binary files differnew file mode 100644 index 0000000..b2045c9 --- /dev/null +++ b/uml/api.png |
