person's parents?

2 views
Skip to first unread message

karmen

unread,
Jan 21, 2010, 7:11:51 PM1/21/10
to Ruby FS Stack
How do I get a person's parents, father, and mother?
The person that I am getting back from match.person and
client.familytree_v2.person(ref) both don't have references to
parents, father, or mother.

the match has parents. should I be using the parents from match
instead?

Thanks.
Karmen

Jimmy Z

unread,
Jan 21, 2010, 11:38:56 PM1/21/10
to Ruby FS Stack
The parents from match will have limited data. To get parents in a
person read do the following:

person = client.familytree_v2.person ref, :parents => 'all'
or
person = client.familytree_v2.person ref, :parents => 'summary'

if you request 'all', you will get all sets of parents, or 'summary'
will give you back just the summary or default parents (one set).

This only gives you the IDs for the parents, but you can do the
following:

ids = person.parents[0].parents.collect{|p|p.id} #=> will give you
both parent IDs for the first set
parent_records = client.familytree_v2.person ids #=> will give you the
person records for both parents

person.parents #=> is the array of parent sets
person.parents[0].parents #=> is the array of parents in the first
set.

Does this help?

--
Jimmy

karmen

unread,
Jan 21, 2010, 11:43:44 PM1/21/10
to Ruby FS Stack
yes, that should do the trick! :) Can't wait to try it out tomorrow.
*fingers crossed*

Thanks.

Karmen

Reply all
Reply to author
Forward
0 new messages