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

Inherits:
AssertionValue show all
Defined in:
lib/ruby-fs-stack/enunciate/familytree.rb,
lib/ruby-fs-stack/familytree/ordinance.rb

Overview

An ordinance value.

Instance Attribute Summary collapse

Attributes inherited from AssertionValue

#id, #title

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AssertionValue

#to_json

Instance Attribute Details

#dateObject

The date the assertion occurred.



5706
5707
5708
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5706

def date
  @date
end

#parentsObject

the parents in a sealing.



5710
5711
5712
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5710

def parents
  @parents
end

#placeObject

The place the assertion occurred.



5708
5709
5710
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5708

def place
  @place
end

#templeObject

The temple code if the ordinance was performed in a temple.



5704
5705
5706
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5704

def temple
  @temple
end

#typeObject

The type of the ordinance.



5702
5703
5704
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5702

def type
  @type
end

Class Method Details

.from_json(o) ⇒ Object

constructs a OrdinanceValue from a (parsed) JSON hash



5742
5743
5744
5745
5746
5747
5748
5749
5750
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5742

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_date(value) ⇒ Object



21
22
23
24
# File 'lib/ruby-fs-stack/familytree/ordinance.rb', line 21

def add_date(value)
  self.date = GenDate.new
  self.date.original = value
end

#add_father(father_id) ⇒ Object



35
36
37
# File 'lib/ruby-fs-stack/familytree/ordinance.rb', line 35

def add_father(father_id)
  add_parent('Male',father_id)
end

#add_mother(mother_id) ⇒ Object



31
32
33
# File 'lib/ruby-fs-stack/familytree/ordinance.rb', line 31

def add_mother(mother_id)
  add_parent('Female',mother_id)
end

#add_parent(gender, id) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/ruby-fs-stack/familytree/ordinance.rb', line 39

def add_parent(gender, id)
  add_parents!
  parent = PersonReference.new
  parent.id = id
  parent.gender = gender
  self.parents << parent
end

#add_place(value) ⇒ Object



26
27
28
29
# File 'lib/ruby-fs-stack/familytree/ordinance.rb', line 26

def add_place(value)
  self.place = Place.new
  self.place.original = value
end

#init_jaxb_json_hash(_o) ⇒ Object

initializes this OrdinanceValue with a json hash



5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5728

def init_jaxb_json_hash(_o)
  super _o
  @type = String.from_json(_o['type']) unless _o['type'].nil?
  @temple = String.from_json(_o['temple']) unless _o['temple'].nil?
  @date = Org::Familysearch::Ws::Familytree::V2::Schema::GenDate.from_json(_o['date']) unless _o['date'].nil?
  @place = Org::Familysearch::Ws::Familytree::V2::Schema::Place.from_json(_o['place']) unless _o['place'].nil?
  if !_o['parents'].nil?
    @parents = Array.new
    _oa = _o['parents']
    _oa.each { | _item | @parents.push Org::Familysearch::Ws::Familytree::V2::Schema::PersonReference.from_json(_item) }
  end
end

#to_jaxb_json_hashObject

the json hash for this OrdinanceValue



5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5713

def to_jaxb_json_hash
  _h = super
  _h['type'] = type.to_jaxb_json_hash unless type.nil?
  _h['temple'] = temple.to_jaxb_json_hash unless temple.nil?
  _h['date'] = date.to_jaxb_json_hash unless date.nil?
  _h['place'] = place.to_jaxb_json_hash unless place.nil?
  if !parents.nil?
    _ha = Array.new
    parents.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['parents'] = _ha
  end
  return _h
end