Sha256: c8232fc354a36b2ebabb84938d3d62979126863066f78c774198e4a0e25db8be

Contents?: true

Size: 926 Bytes

Versions: 20

Compression:

Stored size: 926 Bytes

Contents

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

tree = GraphViz::FamilyTree.new do
  generation do
    abraham.is_a_man( "Abraham" )
    mona.is_a_woman( "Mona" )
    
    abraham.is_maried_with mona
    
    clancy.is_a_man( "Clancy" )
    jackeline.is_a_woman( "Jackeline" )
    
    clancy.is_maried_with jackeline
  end
  
  generation do
    herb.is_a_man( "Herb" )
    homer.is_a_man( "Homer" )
    
    marge.is_a_woman( "Marge" )
    patty.is_a_woman( "Patty" )
    selma.is_a_woman( "Selma" )    

    homer.is_maried_with marge
  end
  
  couple( abraham, mona ).kids( herb, homer )
  couple( clancy, jackeline ).kids( marge, patty, selma )
  
  generation do
    bart.is_a_boy( "Bart" )
    lisa.is_a_girl( "Lisa" )
    maggie.is_a_girl( "Maggie" )
    ling.is_a_boy( "Ling" )
  end
  
  couple( homer, marge ).kids( bart, lisa, maggie )
  
  ling.kids( selma )
end

puts tree.graph.save( :none => String )

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby-graphviz-1.0.7 examples/sample33.rb
ruby-graphviz-1.0.6 examples/sample33.rb
ruby-graphviz-1.0.5 examples/sample33.rb
ruby-graphviz-1.0.4 examples/sample33.rb
ruby-graphviz-1.0.3 examples/sample33.rb
ruby-graphviz-1.0.2 examples/sample33.rb
ruby-graphviz-1.0.1 examples/sample33.rb
ruby-graphviz-1.0.0 examples/sample33.rb
ruby-graphviz-0.9.21 examples/sample33.rb
ruby-graphviz-0.9.20 examples/sample33.rb
ruby-graphviz-0.9.19 examples/sample33.rb
ruby-graphviz-0.9.18 examples/sample33.rb
ruby-graphviz-0.9.17 examples/sample33.rb
ruby-graphviz-0.9.16 examples/sample33.rb
ruby-graphviz-0.9.15 examples/sample33.rb
ruby-graphviz-0.9.14 examples/sample33.rb
ruby-graphviz-0.9.13 examples/sample33.rb
ruby-graphviz-0.9.12 examples/sample33.rb
ruby-graphviz-0.9.11 examples/sample33.rb
ruby-graphviz-0.9.10 examples/sample33.rb