Class: Cause_record

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

Overview

Cause_record is part of Event_record, recording the cause of the event. They aren't often seen in GEDCOM files.

=EVENT_DETAIL:= … n CAUS <CAUSE_OF_EVENT> 0:1 …

I have added a Restriction notice, a Source_citation_record, and a NOTE. As long as you don't use these fields, the GEDCOM output will be standard. Restriction notice tags, like NOTE and SOUR tags, should be part of every record type, but they aren't.

+1 RESN <RESTRICTION_NOTICE> 0:1 +1 <<SOURCE_CITATION>> 0:M +1 <<NOTE_STRUCTURE>> 0:M

==CAUSE_OF_EVENT:= Size=1:90 Used in special cases to record the reasons which precipitated an event. Normally this will be used subordinate to a death event to show cause of death, such as might be listed on a death certificate.

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

Instance Method Summary collapse

Methods inherited from GEDCOMBase

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

Constructor Details

#initialize(*a) ⇒ Cause_record

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



35
36
37
38
39
40
41
42
43
# File 'lib/gedcom/cause_record.rb', line 35

def initialize(*a)
  super(*a)
  @this_level = [ [:print, "CAUS", :cause] ]
  @sub_level =  [ #level + 1
                  [:print, "RESN", :restriction],
                  [:walk, nil,  :source_citation_record],
                  [:walk, nil, :note_citation_record],
                ]
end

Instance Attribute Details

#causeObject

Returns the value of attribute cause.



29
30
31
# File 'lib/gedcom/cause_record.rb', line 29

def cause
  @cause
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



30
31
32
# File 'lib/gedcom/cause_record.rb', line 30

def note_citation_record
  @note_citation_record
end

#restrictionObject

Returns the value of attribute restriction.



29
30
31
# File 'lib/gedcom/cause_record.rb', line 29

def restriction
  @restriction
end

#source_citation_recordObject

Returns the value of attribute source_citation_record.



29
30
31
# File 'lib/gedcom/cause_record.rb', line 29

def source_citation_record
  @source_citation_record
end