Skip to content

Instantly share code, notes, and snippets.

@jimmyz
Created October 11, 2010 16:49
Show Gist options
  • Save jimmyz/620844 to your computer and use it in GitHub Desktop.
Save jimmyz/620844 to your computer and use it in GitHub Desktop.
FS = Org::Familysearch::Ws::Familytree::V2::Schema
child = FS::Person.new
child.add_name "Jonathan /Hanson/"
child.add_gender "Male"
child.add_birth :date => "1850"
wife = FS::Person.new
wife.add_name "Rebecca /Wilson/"
wife.add_gender "Female"
wife.add_birth :date => "1851"
father = FS::Person.new
father.add_name "Peter /Hanson/"
father.add_gender "Male"
father.add_birth :date => '1820'
mother = FS::Person.new
mother.add_name "Mary /Johnson/"
mother.add_gender "Female"
mother.add_birth :date => '1822'
ch = com.familytree_v2.save_person child
wf = com.familytree_v2.save_person wife
fa = com.familytree_v2.save_person father
mo = com.familytree_v2.save_person mother
r1 = com.familytree_v2.write_relationship ch.id, :parent => fa.id
r2 = com.familytree_v2.write_relationship ch.id, :parent => mo.id, :lineage => 'Biological'
r3 = com.familytree_v2.write_relationship fa.id, :spouse => mo.id, :event => {:type => 'Marriage', :date => '1845'}
r4 = com.familytree_v2.write_relationship ch.id, :spouse => wf.id, :event => {:type => 'Marriage', :date => '1865'}
puts "Child: #{ch.id}"
puts "Wife: #{wf.id}"
puts "Father: #{fa.id}"
puts "Mother: #{mo.id}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment