Class: Org::Familysearch::Ws::Familytree::V2::Schema::Relationship

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-fs-stack/enunciate/familytree.rb,
lib/ruby-fs-stack/familytree/relationship.rb

Overview

A Family Tree relationship.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#assertionsObject

A collection of assertions for this person.



2601
2602
2603
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2601

def assertions
  @assertions
end

#idObject

The id of the person.



2589
2590
2591
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2589

def id
  @id
end

#personasObject

(no documentation provided)



2603
2604
2605
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2603

def personas
  @personas
end

#personIdObject

In the case of a persona, the id of the person of which this is a persona.



2593
2594
2595
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2593

def personId
  @personId
end

#propertiesObject

A collection of properties for this relationship.



2599
2600
2601
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2599

def properties
  @properties
end

#requestedIdObject

The id of the person.



2591
2592
2593
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2591

def requestedId
  @requestedId
end

#tempIdObject

A temporary id for this person (e.g. for a person not persisted yet).



2595
2596
2597
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2595

def tempId
  @tempId
end

#versionObject

the relationship version.



2597
2598
2599
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2597

def version
  @version
end

Class Method Details

.from_json(o) ⇒ Object

constructs a Relationship from a (parsed) JSON hash



2645
2646
2647
2648
2649
2650
2651
2652
2653
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2645

def self.from_json(o)
  if o.nil?
    return nil
  else
    inst = new
    inst.init_jaxb_json_hash o
    return inst
  end
end

Instance Method Details

#add_event(event_hash) ⇒ Object

Params

  • event_hash - Accepts the following options

** :type - ‘Marriage’, etc. REQUIRED ** :date - ‘Utah, United States’ (optional) ** :place - ‘16 Nov 1987’ (optional)



62
63
64
65
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 62

def add_event(event_hash)
  add_assertions!
  self.assertions.add_event(event_hash)
end

#add_existsObject



52
53
54
55
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 52

def add_exists
  add_assertions!
  self.assertions.add_exists
end

#add_lineage_characteristic(lineage) ⇒ Object



47
48
49
50
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 47

def add_lineage_characteristic(lineage)
  add_assertions!
  self.assertions.add_characteristic(:type => 'Lineage', :lineage => lineage)
end

#add_ordinance(ordinance_hash) ⇒ Object

Params

  • ordinance_hash - Accepts the following options

** :type - ‘Sealing_to_Spouse’, etc. REQUIRED ** :date - ‘Utah, United States’ (optional) ** :place - ‘16 Nov 1987’ (optional) ** :temple - ‘SLAKE’



73
74
75
76
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 73

def add_ordinance(ordinance_hash)
  add_assertions!
  self.assertions.add_ordinance(ordinance_hash)
end

#init_jaxb_json_hash(_o) ⇒ Object

initializes this Relationship with a json hash



2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2629

def init_jaxb_json_hash(_o)
  @id = String.from_json(_o['id']) unless _o['id'].nil?
  @requestedId = String.from_json(_o['requestedId']) unless _o['requestedId'].nil?
  @personId = String.from_json(_o['personId']) unless _o['personId'].nil?
  @tempId = String.from_json(_o['tempId']) unless _o['tempId'].nil?
  @version = String.from_json(_o['version']) unless _o['version'].nil?
  @properties = Org::Familysearch::Ws::Familytree::V2::Schema::RelationshipProperties.from_json(_o['properties']) unless _o['properties'].nil?
  @assertions = Org::Familysearch::Ws::Familytree::V2::Schema::RelationshipAssertions.from_json(_o['assertions']) unless _o['assertions'].nil?
  if !_o['personas'].nil?
    @personas = Array.new
    _oa = _o['personas']
    _oa.each { | _item | @personas.push Org::Familysearch::Ws::Familytree::V2::Schema::PersonaReference.from_json(_item) }
  end
end

#to_jaxb_json_hashObject

the json hash for this Relationship



2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2606

def to_jaxb_json_hash
  _h = {}
  _h['id'] = id.to_jaxb_json_hash unless id.nil?
  _h['requestedId'] = requestedId.to_jaxb_json_hash unless requestedId.nil?
  _h['personId'] = personId.to_jaxb_json_hash unless personId.nil?
  _h['tempId'] = tempId.to_jaxb_json_hash unless tempId.nil?
  _h['version'] = version.to_jaxb_json_hash unless version.nil?
  _h['properties'] = properties.to_jaxb_json_hash unless properties.nil?
  _h['assertions'] = assertions.to_jaxb_json_hash unless assertions.nil?
  if !personas.nil?
    _ha = Array.new
    personas.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['personas'] = _ha
  end
  return _h
end

#to_jsonObject

the json (string form) for this Relationship



2624
2625
2626
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2624

def to_json
  to_jaxb_json_hash.to_json
end