Sha256: b2b4574848fda8bb43e41727617796ed83d0d8ab40d3125e5dda5c025b26eb10

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

$:.unshift( "../lib" );
require 'graphviz/family_tree'

tree = GraphViz::FamilyTree.new do
  generation do
    benoist.is_a_man( "Benoist" )
    nathalie.is_a_woman( "Nathalie" )
    
    benoist.is_maried_with nathalie
    
    michel.is_a_man( "Michel" )
    brigitte.is_a_woman( "Brigitte" )
    
    michel.is_maried_with brigitte
  end
  
  generation do
    charlotte.is_a_woman( "Charlotte" )
    amelie.is_a_woman( "Amelie" )
    clement.is_a_man( "Clement" )
    gregoire.is_a_man( "Gregoire" )
    
    muriel.is_a_woman( "Muriel" )
    gilles.is_a_man( "Gilles" )

    gregoire.is_maried_with muriel
  end
  
  couple( michel, brigitte ).kids( muriel, gilles )
  couple( benoist, nathalie ).kids( charlotte, amelie, clement, gregoire )
  
  generation do
    arthur.is_a_boy( "Arthur" )
    colyne.is_a_girl( "Colyne" )
    benedict.is_a_boy( "Benedict" )
    maia.is_a_girl( "Maia" )
    enaitz.is_a_boy( "Enaitz" )
    milo.is_a_boy( "Milo" )
  end
  
  gregoire.kids( arthur, colyne, benedict )
  couple( gregoire, muriel ).kids( maia )
  muriel.kids( enaitz, milo )
end

tree.graph.save( :png => "#{$0}.png" )

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.11 examples/sample40.rb
ruby-graphviz-0.9.10 examples/sample40.rb