Class: Org::Familysearch::Ws::Familytree::V2::Schema::PersonAssertions
- Defined in:
- lib/ruby-fs-stack/enunciate/familytree.rb,
lib/ruby-fs-stack/familytree/person.rb
Overview
A FamilyTree person asseritons section.
Instance Attribute Summary collapse
-
#characteristics ⇒ Object
A collection of characteristics for this person.
-
#events ⇒ Object
A collection of events for this person.
-
#exists ⇒ Object
A collection of exists assertions for this person.
-
#genders ⇒ Object
A collection of genders for this person.
-
#names ⇒ Object
A collection of names for this person.
-
#ordinances ⇒ Object
A collection of ordinances for this person.
Class Method Summary collapse
-
.from_json(o) ⇒ Object
constructs a PersonAssertions from a (parsed) JSON hash.
Instance Method Summary collapse
- #add_event(options) ⇒ Object
- #add_gender(value) ⇒ Object
- #add_name(value) ⇒ Object
- #add_ordinance(options) ⇒ Object
-
#init_jaxb_json_hash(_o) ⇒ Object
initializes this PersonAssertions with a json hash.
- #select_event_summary(type, value_id) ⇒ Object
- #select_name(value_id) ⇒ Object
-
#to_jaxb_json_hash ⇒ Object
the json hash for this PersonAssertions.
-
#to_json ⇒ Object
the json (string form) for this PersonAssertions.
Instance Attribute Details
#characteristics ⇒ Object
A collection of characteristics for this person.
1199 1200 1201 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1199 def characteristics @characteristics end |
#events ⇒ Object
A collection of events for this person.
1197 1198 1199 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1197 def events @events end |
#exists ⇒ Object
A collection of exists assertions for this person.
1191 1192 1193 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1191 def exists @exists end |
#genders ⇒ Object
A collection of genders for this person.
1195 1196 1197 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1195 def genders @genders end |
#names ⇒ Object
A collection of names for this person.
1193 1194 1195 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1193 def names @names end |
#ordinances ⇒ Object
A collection of ordinances for this person.
1201 1202 1203 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1201 def ordinances @ordinances end |
Class Method Details
.from_json(o) ⇒ Object
constructs a PersonAssertions from a (parsed) JSON hash
1279 1280 1281 1282 1283 1284 1285 1286 1287 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1279 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(options) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 25 def add_event() self.events ||= [] e = EventAssertion.new e.add_value() self.events << e end |
#add_gender(value) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 4 def add_gender(value) self.genders ||= [] g = GenderAssertion.new g.add_value(value) self.genders << g end |
#add_name(value) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 11 def add_name(value) self.names ||= [] n = NameAssertion.new n.add_value(value) self.names << n end |
#add_ordinance(options) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 39 def add_ordinance() self.ordinances ||= [] o = OrdinanceAssertion.new o.add_value() self.ordinances << o end |
#init_jaxb_json_hash(_o) ⇒ Object
initializes this PersonAssertions with a json hash
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1245 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['names'].nil? @names = Array.new _oa = _o['names'] _oa.each { | _item | @names.push Org::Familysearch::Ws::Familytree::V2::Schema::NameAssertion.from_json(_item) } end if !_o['genders'].nil? @genders = Array.new _oa = _o['genders'] _oa.each { | _item | @genders.push Org::Familysearch::Ws::Familytree::V2::Schema::GenderAssertion.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 |
#select_event_summary(type, value_id) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 32 def select_event_summary(type,value_id) self.events ||= [] e = EventAssertion.new e.select(type,value_id) self.events << e end |
#select_name(value_id) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/ruby-fs-stack/familytree/person.rb', line 18 def select_name(value_id) self.names ||= [] n = NameAssertion.new n.select(value_id) self.names << n end |
#to_jaxb_json_hash ⇒ Object
the json hash for this PersonAssertions
1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1204 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 !names.nil? _ha = Array.new names.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['names'] = _ha end if !genders.nil? _ha = Array.new genders.each { | _item | _ha.push _item.to_jaxb_json_hash } _h['genders'] = _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_json ⇒ Object
the json (string form) for this PersonAssertions
1240 1241 1242 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 1240 def to_json to_jaxb_json_hash.to_json end |