ruby-fs-stack 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -106,6 +106,7 @@ or for the pure Ruby implementation
106
106
  person.select_name_summary "100078"
107
107
  person.select_birth_summary "1089498"
108
108
  person.select_death_summary "7834987"
109
+ person.select_spouse_summary "KWQS-BBB"
109
110
  # you must set both the mother and the father summary unless you want a single parent as the summary parents.
110
111
  person.select_mother_summary "KWQS-MOM"
111
112
  person.select_father_summary "KWQS-DAD"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -565,6 +565,21 @@ module Org::Familysearch::Ws::Familytree::V2::Schema
565
565
  end
566
566
  end
567
567
 
568
+ class FamilyReference
569
+ def select_spouse(spouse_id)
570
+ add_parents!
571
+ self.action = 'Select'
572
+ parent = PersonReference.new
573
+ parent.id = spouse_id
574
+ self.parents << parent
575
+ end
576
+
577
+ private
578
+ def add_parents!
579
+ self.parents ||= []
580
+ end
581
+ end
582
+
568
583
  class ParentsReference
569
584
  def select_parent(parent_id, gender)
570
585
  add_parents!
@@ -866,6 +881,25 @@ module Org::Familysearch::Ws::Familytree::V2::Schema
866
881
  parents << couple
867
882
  end
868
883
 
884
+ # Select the spouse for the summary view. This should be called on a Person record that
885
+ # contains a person id and version.
886
+ #
887
+ # ====Params
888
+ # <tt>person_id</tt> - the person id of the spouse that you would like to set as the summary
889
+ #
890
+ # ===Example
891
+ # person = com.familytree_v2.person 'KWQS-BBR', :names => 'none', :genders => 'none', :events => 'none'
892
+ # person.select_spouse_summary('KWQS-BBQ')
893
+ # com.familytree_v2.save_person person
894
+ #
895
+ # This is the recommended approach, to start with a "Version" person (no names, genders, or events)
896
+ def select_spouse_summary(person_id)
897
+ add_families!
898
+ family = FamilyReference.new
899
+ family.select_spouse(person_id)
900
+ families << family
901
+ end
902
+
869
903
  def baptisms
870
904
  select_ordinances('Baptism')
871
905
  end
@@ -997,6 +1031,10 @@ module Org::Familysearch::Ws::Familytree::V2::Schema
997
1031
  self.parents ||= []
998
1032
  end
999
1033
 
1034
+ def add_families!
1035
+ self.families ||= []
1036
+ end
1037
+
1000
1038
  def add_relationships!
1001
1039
  self.relationships ||= PersonRelationships.new
1002
1040
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-fs-stack}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jimmy Zimmerman"]
12
- s.date = %q{2010-01-07}
12
+ s.date = %q{2010-01-08}
13
13
  s.description = %q{A library that enables you to read and update information with the new.familysearch.org API.}
14
14
  s.email = %q{jimmy.zimmerman@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -194,8 +194,7 @@ describe Org::Familysearch::Ws::Familytree::V2::Schema::Person do
194
194
  end
195
195
 
196
196
  it "should return the 'selected' birth if an assertion is selected" do
197
- pending
198
- @person.births[1].selected = true
197
+ @person.births[1].selected = Org::Familysearch::Ws::Familytree::V2::Schema::ValueSelection.new
199
198
  @person.birth.should == @person.births[1]
200
199
  end
201
200
 
@@ -259,8 +258,7 @@ describe Org::Familysearch::Ws::Familytree::V2::Schema::Person do
259
258
  end
260
259
 
261
260
  it "should return the 'selected' death if an assertion is selected" do
262
- pending
263
- @person.deaths[1].selected = true
261
+ @person.deaths[1].selected = Org::Familysearch::Ws::Familytree::V2::Schema::ValueSelection.new
264
262
  @person.death.should == @person.deaths[1]
265
263
  end
266
264
 
@@ -370,6 +368,20 @@ describe Org::Familysearch::Ws::Familytree::V2::Schema::Person do
370
368
 
371
369
  end
372
370
 
371
+ describe "select_spouse_summary" do
372
+
373
+ it "should accept a spouse's ID" do
374
+ @person.select_spouse_summary('KWQS-BBB')
375
+ end
376
+
377
+ it "should set the families with given spouse as a selected parent" do
378
+ @person.select_spouse_summary('KWQS-BBB')
379
+ @person.families[0].parents[0].id.should == 'KWQS-BBB'
380
+ @person.families[0].action.should == 'Select'
381
+ end
382
+
383
+ end
384
+
373
385
  end
374
386
 
375
387
  describe "baptisms" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-fs-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmy Zimmerman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-07 00:00:00 -07:00
12
+ date: 2010-01-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency