Class: Association_record

Inherits:
GEDCOMBase show all
Defined in:
lib/gedcom/association_record.rb

Overview

Internal representation of the GEDCOM ASSO record types.

A relationship between an Individual_record and one of the other level 0 record types, as defined by the TYPE tag. The default being another a relationship with another Individual_record.

ASSOCIATION_STRUCTURE:=

n ASSO @<XREF:TYPE>@                   {0:M}
  +1 TYPE <RECORD_TYPE>                {1:1}
  +1 RELA <RELATION_IS_DESCRIPTOR>     {1:1}
  +1 <<NOTE_STRUCTURE>>                {0:M}
  +1 <<SOURCE_CITATION>>               {0:M}

RECORD_TYPE:= Size=3:4

FAM | INDI | NOTE | OBJE | REPO | SOUR | SUBM | SUBN

An indicator of the record type being pointed to or used. For example if in an ASSOciation, an
INDIvidual record were to be ASSOciated with a FAM record then:
  0 INDI
    1 ASSO @F1@
      2 TYPE FAM /* ASSOCIATION is with a FAM record.
      2 RELA Witness at marriage

RELATION_IS_DESCRIPTOR:= Size=1:25

A word or phrase that states object 1's relation is object 2. For example you would read the following
as "Joe Jacob's great grandson is the submitter pointed to by the @XREF:SUBM@":
   0 INDI
     1 NAME Joe /Jacob/
     1 ASSO @<XREF:SUBM>@
      2 TYPE SUBM
      2 RELA great grandson

The attributes are all arrays for the level +1 tags/records.

  • Those ending in _ref are GEDCOM XREF index keys

  • Those ending in _record are array of classes of that type.

  • The remainder are arrays of attributes that could be present in this record.

Instance Attribute Summary collapse

Attributes inherited from GEDCOMBase

#restriction

Instance Method Summary collapse

Methods inherited from GEDCOMBase

#changed, #changed?, #created?, #find, #locked?, no_tabs, #private?, #save, tabs, #to_db, #to_gedcom, #to_s, #token_to_s

Constructor Details

#initialize(*a) ⇒ Association_record

new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.



46
47
48
49
50
51
52
53
54
55
# File 'lib/gedcom/association_record.rb', line 46

def initialize(*a)
  super(*a)
  @this_level = [ [:xref, "ASSO", :association_ref ] ]
  @sub_level =  [ #level 1
                  [:print, "TYPE",    :associated_record_tag ],
                  [:print, "RELA",    :relationship_description ],
                  [:walk, nil,    :source_citation_record ],
                  [:walk, nil,    :note_citation_record ],
                ]
end

Instance Attribute Details

#associated_record_tagObject

Returns the value of attribute associated_record_tag.



40
41
42
# File 'lib/gedcom/association_record.rb', line 40

def associated_record_tag
  @associated_record_tag
end

#association_refObject

Returns the value of attribute association_ref.



40
41
42
# File 'lib/gedcom/association_record.rb', line 40

def association_ref
  @association_ref
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



41
42
43
# File 'lib/gedcom/association_record.rb', line 41

def note_citation_record
  @note_citation_record
end

#relationship_descriptionObject

Returns the value of attribute relationship_description.



40
41
42
# File 'lib/gedcom/association_record.rb', line 40

def relationship_description
  @relationship_description
end

#source_citation_recordObject

Returns the value of attribute source_citation_record.



41
42
43
# File 'lib/gedcom/association_record.rb', line 41

def source_citation_record
  @source_citation_record
end