queirozfcom / rachinations

Other
2 stars 0 forks source link

When an edge or node is added to a diagram, make that element available as an attribute #55

Closed queirozfcom closed 9 years ago

queirozfcom commented 9 years ago

For instance:

d = Diagram.new
d.add_node! Pool, name: 'p1', initial_value: 5

puts d.p1.resource_count # should print 5

This will make it a lot easier to access a diagram's elements for testing, debugging and so on.

queirozfcom commented 9 years ago

In order to do this, I cannot let nodes or edges (or any other element, for that matter) have names that can't be a valid Ruby variable name.

queirozfcom commented 9 years ago

aee2a9544afba48af50c9013d8c6249127fb2c9d