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

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#actionObject

the change action.



3878
3879
3880
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3878

def action
  @action
end

#contributorObject

a reference to the contributor of the change.



3888
3889
3890
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3888

def contributor
  @contributor
end

#idObject

the change id.



3874
3875
3876
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3874

def id
  @id
end

#parentObject

the change parent id.



3880
3881
3882
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3880

def parent
  @parent
end

#previousObject

a list of references to the previous extract persons of the change.



3886
3887
3888
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3886

def previous
  @previous
end

#resultsObject

a list of references to the resulting persons of the change.



3884
3885
3886
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3884

def results
  @results
end

#sourcesObject

a list of person references in a change entry.



3882
3883
3884
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3882

def sources
  @sources
end

#submitterObject

a reference to the submitter of the change.



3890
3891
3892
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3890

def submitter
  @submitter
end

#timestampObject

the timestamp of the change.



3892
3893
3894
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3892

def timestamp
  @timestamp
end

#typeObject

the change type.



3876
3877
3878
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3876

def type
  @type
end

Class Method Details

.from_json(o) ⇒ Object

constructs a Change from a (parsed) JSON hash



3954
3955
3956
3957
3958
3959
3960
3961
3962
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3954

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 Change with a json hash



3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3928

def init_jaxb_json_hash(_o)
  @id = String.from_json(_o['id']) unless _o['id'].nil?
  @type = String.from_json(_o['type']) unless _o['type'].nil?
  @action = Org::Familysearch::Ws::Familytree::V2::Schema::ChangeAction.from_json(_o['action']) unless _o['action'].nil?
  @parent = Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_o['parent']) unless _o['parent'].nil?
  if !_o['sourcePersons'].nil?
    @sources = Array.new
    _oa = _o['sourcePersons']
    _oa.each { | _item | @sources.push Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_item) }
  end
  if !_o['resultPersons'].nil?
    @results = Array.new
    _oa = _o['resultPersons']
    _oa.each { | _item | @results.push Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_item) }
  end
  if !_o['previousPersons'].nil?
    @previous = Array.new
    _oa = _o['previousPersons']
    _oa.each { | _item | @previous.push Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_item) }
  end
  @contributor = Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_o['contributor']) unless _o['contributor'].nil?
  @submitter = Org::Familysearch::Ws::Familytree::V2::Schema::EntityReference.from_json(_o['submitter']) unless _o['submitter'].nil?
  @timestamp = Time.from_json(_o['timestamp']) unless _o['timestamp'].nil?
end

#to_jaxb_json_hashObject

the json hash for this Change



3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3895

def to_jaxb_json_hash
  _h = {}
  _h['id'] = id.to_jaxb_json_hash unless id.nil?
  _h['type'] = type.to_jaxb_json_hash unless type.nil?
  _h['action'] = action.to_jaxb_json_hash unless action.nil?
  _h['parent'] = parent.to_jaxb_json_hash unless parent.nil?
  if !sources.nil?
    _ha = Array.new
    sources.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['sourcePersons'] = _ha
  end
  if !results.nil?
    _ha = Array.new
    results.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['resultPersons'] = _ha
  end
  if !previous.nil?
    _ha = Array.new
    previous.each { | _item | _ha.push _item.to_jaxb_json_hash }
    _h['previousPersons'] = _ha
  end
  _h['contributor'] = contributor.to_jaxb_json_hash unless contributor.nil?
  _h['submitter'] = submitter.to_jaxb_json_hash unless submitter.nil?
  _h['timestamp'] = timestamp.to_jaxb_json_hash unless timestamp.nil?
  return _h
end

#to_jsonObject

the json (string form) for this Change



3923
3924
3925
# File 'lib/ruby-fs-stack/enunciate/familytree.rb', line 3923

def to_json
  to_jaxb_json_hash.to_json
end