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

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

Overview

A name 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

#formsObject

The name forms.



5881
5882
5883
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5881

def forms
  @forms
end

#typeObject

The type of this name.



5879
5880
5881
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5879

def type
  @type
end

Class Method Details

.from_json(o) ⇒ Object

constructs a NameValue from a (parsed) JSON hash



5907
5908
5909
5910
5911
5912
5913
5914
5915
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5907

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



48
49
50
51
52
53
# File 'lib/ruby-fs-stack/familytree/name.rb', line 48

def add_form(value)
  self.forms = []
  f = NameForm.new
  f.set_name(value)
  self.forms << f
end

#init_jaxb_json_hash(_o) ⇒ Object

initializes this NameValue with a json hash



5896
5897
5898
5899
5900
5901
5902
5903
5904
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5896

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

#to_jaxb_json_hashObject

the json hash for this NameValue



5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 5884

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