Permalink
Browse files

graphical representation (UML Class Diagram) of the Rx schema.

png <-- dot <-- lua-Coat
  • Loading branch information...
1 parent 7b18786 commit 2f0f999ed3a3a1dc1fe0d1ad5f06786a87574614 @fperrad fperrad committed Oct 15, 2010
Showing with 52 additions and 0 deletions.
  1. +10 −0 uml/Makefile
  2. +13 −0 uml/api.dot
  3. +29 −0 uml/api.lua
  4. BIN uml/api.png
View
@@ -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
View
@@ -0,0 +1,13 @@
+digraph {
+
+ node [shape=record];
+
+ "Method"
+ [label="{\N|authentication : boolean\lbase_url : string\ldescription : string\lexpected : table&lt;number&gt;\lformat : table&lt;string&gt;\lmethod : string\loptional : table&lt;string&gt;\lpath : string\lrequired : table&lt;string&gt;\l}"];
+
+ "API"
+ [label="{\N|authentication : boolean\lauthority : string\lbase_url : string\ldescription : string\lformat : table&lt;string&gt;\lmeta : table&lt;string,string&gt;\lmethods : table&lt;string,Method&gt;\lname : string\lversion : string\l}"];
+ "API" -> "Method" // attr isa table<string,Method>
+ [label = "methods", arrowhead = none, arrowtail = odiamond];
+
+}
View
@@ -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>' }
+
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f0f999

Please sign in to comment.