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

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

Overview

A FamilyTree relationships assertions section.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#characteristicsObject

A collection of characteristics for this relationship.



2490
2491
2492
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2490

def characteristics
  @characteristics
end

#eventsObject

A collection of events for this relationship.



2488
2489
2490
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2488

def events
  @events
end

#existsObject

A collection of exists assertions for this relationship.



2486
2487
2488
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2486

def exists
  @exists
end

#ordinancesObject

A collection of ordinances for this relationship.



2492
2493
2494
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2492

def ordinances
  @ordinances
end

Class Method Details

.from_json(o) ⇒ Object

constructs a RelationshipAssertions from a (parsed) JSON hash



2550
2551
2552
2553
2554
2555
2556
2557
2558
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2550

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_characteristic(options) ⇒ Object

Params

  • options - :type (‘Lineage’ or valid CharacteristicType), :lineage => ‘Biological’, etc.



6
7
8
9
10
11
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 6

def add_characteristic(options)
  self.characteristics ||= []
  characteristic = CharacteristicAssertion.new
  characteristic.add_value(options)
  self.characteristics << characteristic
end

#add_event(options) ⇒ Object

Params

  • options - Accepts the following options

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



18
19
20
21
22
23
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 18

def add_event(options)
  self.events ||= []
  event = EventAssertion.new
  event.add_value(options)
  self.events << event
end

#add_existsObject



38
39
40
41
42
43
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 38

def add_exists
  self.exists ||= []
  exist = ExistsAssertion.new
  exist.add_value
  self.exists << exist
end

#add_ordinance(options) ⇒ Object

Params

  • options - Accepts the following options

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



31
32
33
34
35
36
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 31

def add_ordinance(options)
  self.ordinances ||= []
  ordinance = OrdinanceAssertion.new
  ordinance.add_value(options)
  self.ordinances << ordinance
end

#init_jaxb_json_hash(_o) ⇒ Object

initializes this RelationshipAssertions with a json hash



2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2526

def init_jaxb_json_hash(_o)
  if !_o['exists'].nil?
    @exists = Array.new
    _oa = _o['exists']
    _oa.each { | _item | @exists.push Org::Familysearch::Ws::Familytree::V2::Schema::ExistsAssertion.from_json(_item) }
  end
  if !_o['events'].nil?
    @events = Array.new
    _oa = _o['events']
    _oa.each { | _item | @events.push Org::Familysearch::Ws::Familytree::V2::Schema::EventAssertion.from_json(_item) }
  end
  if !_o['characteristics'].nil?
    @characteristics = Array.new
    _oa = _o['characteristics']
    _oa.each { | _item | @characteristics.push Org::Familysearch::Ws::Familytree::V2::Schema::CharacteristicAssertion.from_json(_item) }
  end
  if !_o['ordinances'].nil?
    @ordinances = Array.new
    _oa = _o['ordinances']
    _oa.each { | _item | @ordinances.push Org::Familysearch::Ws::Familytree::V2::Schema::OrdinanceAssertion.from_json(_item) }
  end
end

#to_jaxb_json_hashObject

the json hash for this RelationshipAssertions



2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2495

def to_jaxb_json_hash
  _h = {}
  if !exists.nil?
    _ha = Array.new
    exists.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['exists'] = _ha
  end
  if !events.nil?
    _ha = Array.new
    events.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['events'] = _ha
  end
  if !characteristics.nil?
    _ha = Array.new
    characteristics.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['characteristics'] = _ha
  end
  if !ordinances.nil?
    _ha = Array.new
    ordinances.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['ordinances'] = _ha
  end
  return _h
end

#to_jsonObject

the json (string form) for this RelationshipAssertions



2521
2522
2523
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 2521

def to_json
  to_jaxb_json_hash.to_json
end