-
Notifications
You must be signed in to change notification settings - Fork 0
Home
dmikhr edited this page Dec 11, 2019
·
2 revisions
Gem takes a hash as input which includes information about code:
- methods names
- number of arguments
- method length (lines of code)
- number of conditions inside a method
Based on supplied data gem renders svg file with a "dude" that has:
- N hands (N - number of methods)
- each hand has Y fingers (Y - number of arguments)
- "muscles" (number of conditions in method)
If method length is higher than a predermined value then arm will be longer than normal.
The following hash will produce a figure presented below:
object = { name: "ThingCollection",
:methods=>
[{ name: :initialize, args: 3, length: 2, conditions: 0 },
{ name: :all_types, args: 0, length: 6, conditions: 2 },
{ name: :one_type_things, args: 6, length: 9, conditions: 0 },
{ name: :one_thing_by_type, args: 2, length: 9, conditions: 0 },
{ name: :weather_clothing, args: 4, length: 10, conditions: 0 },
{ name: :message, args: 1, length: 6, conditions: 1 },
{ name: :signal, args: 5, length: 10, conditions: 4 }] }