Class: Org::Familysearch::Ws::Familytree::V2::Schema::EventAssertion
- Defined in:
- lib/ruby-fs-stack/enunciate/familytree.rb,
lib/ruby-fs-stack/familytree/event.rb
Overview
An event of a person.
Instance Attribute Summary collapse
-
#value ⇒ Object
The value for this assertion.
Attributes inherited from Assertion
#action, #citations, #contributors, #disposition, #id, #modifiable, #modified, #notes, #personas, #selected, #tempId, #version
Class Method Summary collapse
-
.from_json(o) ⇒ Object
constructs a EventAssertion from a (parsed) JSON hash.
Instance Method Summary collapse
-
#add_value(options) ⇒ Object
Params *
options
- requires a :type option and accepts an (optional) :date and :place option. -
#date ⇒ Object
To make porting code from v1 to v2 easier, date will reference value.date.
-
#init_jaxb_json_hash(_o) ⇒ Object
initializes this EventAssertion with a json hash.
-
#place ⇒ Object
To make porting code from v1 to v2 easier, date will reference value.date.
- #select(type, value_id) ⇒ Object
-
#to_jaxb_json_hash ⇒ Object
the json hash for this EventAssertion.
Methods inherited from Assertion
Instance Attribute Details
#value ⇒ Object
The value for this assertion.
7172 7173 7174 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 7172 def value @value end |
Class Method Details
.from_json(o) ⇒ Object
constructs a EventAssertion from a (parsed) JSON hash
7188 7189 7190 7191 7192 7193 7194 7195 7196 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 7188 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_value(options) ⇒ Object
Params
-
options
- requires a :type option and accepts an (optional) :date and :place option
Example
person.add_birth :date => '12 Aug 1902', :place => 'United States'
22 23 24 25 26 27 28 |
# File 'lib/ruby-fs-stack/familytree/event.rb', line 22 def add_value() raise ArgumentError, "missing option[:type]" if [:type].nil? self.value = EventValue.new self.value.type = [:type] self.value.add_date([:date]) if [:date] self.value.add_place([:place]) if [:place] end |
#date ⇒ Object
To make porting code from v1 to v2 easier, date will reference value.date
39 40 41 |
# File 'lib/ruby-fs-stack/familytree/event.rb', line 39 def date value.date end |
#init_jaxb_json_hash(_o) ⇒ Object
initializes this EventAssertion with a json hash
7182 7183 7184 7185 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 7182 def init_jaxb_json_hash(_o) super _o @value = Org::Familysearch::Ws::Familytree::V2::Schema::EventValue.from_json(_o['value']) unless _o['value'].nil? end |
#place ⇒ Object
To make porting code from v1 to v2 easier, date will reference value.date
45 46 47 |
# File 'lib/ruby-fs-stack/familytree/event.rb', line 45 def place value.place end |
#select(type, value_id) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/ruby-fs-stack/familytree/event.rb', line 30 def select(type,value_id) self.value = EventValue.new self.value.id = value_id self.value.type = type self.action = 'Select' end |
#to_jaxb_json_hash ⇒ Object
the json hash for this EventAssertion
7175 7176 7177 7178 7179 |
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 7175 def to_jaxb_json_hash _h = super _h['value'] = value.to_jaxb_json_hash unless value.nil? return _h end |