Sha256: 472adcae1b39e285b686105e1c0870155df7dfd89c93194ec1aaf3eae55d9b6d

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

# encoding: utf-8
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'graphviz_diagram'

g = Graphviz::Diagram.new
g['Author'].add_attribute 'name', visibility: :private, type: 'String'
g['Author'].add_attribute 'age', visibility: :private, type: 'Age'
g['Author'].add_method 'books', type: 'Array'
g['Author'].add_method 'update', arguments: 'name, age', type: 'Boolean'

g['Book'].add_attribute 'title', type: 'String'
g['Book'].add_method 'author', type: 'Author'

g << g['Book'].belongs_to(g['Author'])
g.output png: 'book_author.png'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graphviz-diagram-0.0.3 examples/book_author.rb
graphviz-diagram-0.0.2 examples/book_author.rb
graphviz-diagram-0.0.1 examples/book_author.rb