Gem Updates

2 views
Skip to first unread message

Jimmy Z

unread,
Feb 27, 2010, 11:28:22 PM2/27/10
to Ruby FS Stack
You may have noticed a few updates in the ruby-fs-stack gem this last
week. Here's what has been updated:

0.4.4 - Added a timeout option to the FsCommunicator. This can be set
in the has with the :timeout symbol or as an attr on an instantiated
FsCommunicator object (com.timeout = 300). Timeout is in seconds.

0.4.5 - Added a father_id, mother_id, and spouse_id convenience method
to the Person. These will return the ids on the summary parents and
spouse only if the person was read with the options of :families =>
'summary' (or 'all') and :parents => 'summary' (or 'all')

0.4.6 - Added functionality for the Pedigree Read to the
FamilyTreeV2::Communicator. This is how it works:

# this returns 4 generations of name, gender, id, and version starting
at me
pedigree = com.familytree_v2.pedigree :me

# to access the root person of the pedigree, use the root method:
pedigree.root #=> root of the pedigree
pedigree.root.full_name #=> 'Jimmy Zimmerman'
pedigree.persons #=> an array of all persons in the pedigree
pedigree.person_ids #=> an array of all person IDs in the pedigree
pedigree.continue_ids #=> the IDs that are found in parent elements,
but that weren't returned in the current pedigree call. Use these to
request the next generations of pedigrees
pedigree.continue_nodes #=> these are the end people in the pedigree
that would have parents that can be fetched
pedigree.continue_node_ids #=> the IDs of the continue_nodes

pedigree.root.father.father.father.father.full_name #=> the 4th great-
grandfather's full name

The pedigree read also allows you to request 2 pedigrees at a time, so
you can do the following:

pedigrees = com.familytree_v2.pedigree ['KWQS-BBQ','KWQS-BBR']
pedigrees.first.root #=> root person in the first pedigree


The Pedigree object also has the ability of injesting other pedigrees
to create a bigger pedigree to crawl. For example:

big_pedigree = com.familytree_v2.pedigree :me
pedigree2 = com.familytree_v2.pedigree big_pedigree.continue_ids.first
big_pedigree.injest(pedigree2)
# I can now go out to further generations because the other pedigree
is stitched in
big_pedigree.root.father.father.father.father.father.father.full_name

Also, you can use the Pedigree object to stitch together regular
Person objects to crawl a pedigree:

pedigree = Org::Familysearch::Ws::Familytree::V2::Schema::Pedigree.new

persons = com.familytree_v2.person [...array of person ids...]
persons.each do |person|
pedigree << person
end
person.root.father.father.birth.date.original

0.4.7 - Improved the mutliple person ID read for the Person Read. You
should no longer need to worry about how many IDs you send to the
person method. The method will check the person.max.ids property and
automatically batch the reads by the maximum. Properties endpoint is
only fetched once per FsCommunicator object. The properties will stay
cached as an instance variable of the communicator object.

This auto-batched person read works really well especially if you are
using the :handle_throttling => true option on the FsCommunicator.

--
Jimmy

karmen

unread,
Mar 17, 2010, 5:24:42 PM3/17/10
to Ruby FS Stack
I just want to say you made my life a million times easier with the
addition of Pedigree read ability!!

Thank you!

Karmen Blake
Genetree

jimmy zimmerman

unread,
Mar 17, 2010, 5:42:52 PM3/17/10
to ruby-f...@googlegroups.com
Glad you like it!

I need to get the content of this email into the documentation and examples. The new pedigree functionality is really fun. It doesn't help so much if you want to support multiple sets of parents, but it works great for the summary pedigree.

--
Jimmy
--
Jimmy Zimmerman
http://jimmyzimmerman.com

karmen

unread,
Mar 17, 2010, 5:50:12 PM3/17/10
to Ruby FS Stack
I appreciate the "documentation" in the specs. That is the first place
I go. :)

http://github.com/jimmyz/ruby-fs-stack/blob/master/spec/familytree_v2/pedigree_spec.rb

Karmen

Reply all
Reply to author
Forward
0 new messages