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

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

Overview

A FamilyTree parents.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionObject

The action.



1120
1121
1122
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1120

def action
  @action
end

#parentsObject

A collection of parents for this family.



1122
1123
1124
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1122

def parents
  @parents
end

Class Method Details

.from_json(o) ⇒ Object

constructs a ParentsReference from a (parsed) JSON hash



1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1152

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

#init_jaxb_json_hash(_o) ⇒ Object

initializes this ParentsReference with a json hash



1142
1143
1144
1145
1146
1147
1148
1149
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1142

def init_jaxb_json_hash(_o)
  @action = String.from_json(_o['action']) unless _o['action'].nil?
  if !_o['parent'].nil?
    @parents = Array.new
    _oa = _o['parent']
    _oa.each { | _item | @parents.push Org::Familysearch::Ws::Familytree::V2::Schema::ParentReference.from_json(_item) }
  end
end

#select_parent(parent_id, gender) ⇒ Object



100
101
102
103
104
105
106
107
# File 'lib/ruby-fs-stack/familytree/relationship.rb', line 100

def select_parent(parent_id, gender)
  add_parents!
  self.action = 'Select'
  parent = PersonReference.new
  parent.gender = gender
  parent.id = parent_id
  self.parents << parent
end

#to_jaxb_json_hashObject

the json hash for this ParentsReference



1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1125

def to_jaxb_json_hash
  _h = {}
  _h['action'] = action.to_jaxb_json_hash unless action.nil?
  if !parents.nil?
    _ha = Array.new
    parents.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['parent'] = _ha
  end
  return _h
end

#to_jsonObject

the json (string form) for this ParentsReference



1137
1138
1139
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1137

def to_json
  to_jaxb_json_hash.to_json
end