Class: Change_date_record

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

Overview

Change_date_record is part of many other records, recording the date and time that the parent record was last altered. It also allows for a comment to be added. Probably not that useful, as the standard only allows for one of these in a parent record. It would be more useful to have a history of changes using multiple Change_records. It would also help to have them in more records.

=CHANGE_DATE:= n CHAN 1:1 +1 DATE <CHANGE_DATE> 1:1 +2 TIME <TIME_VALUE> 0:1 +1 <<NOTE_STRUCTURE>> 0:M

The change date is intended to only record the last change to a record. Some systems may want to manage the change process with more detail, but it is sufficient for GEDCOM purposes to indicate the last time that a record was modified.

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, #to_s_ordered, #to_s_r, #token_to_s, #xref_check

Constructor Details

#initialize(*a) ⇒ Change_date_record

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



31
32
33
34
35
36
37
38
# File 'lib/gedcom/change_date_record.rb', line 31

def initialize(*a)
  super(*a)
  @this_level = [ [ :nodata, "CHAN", nil] ]
  @sub_level =  [ #level + 1
                  [:walk, nil, :date_record],
                  [:walk, nil, :note_citation_record]
                ]
end

Instance Attribute Details

#date_recordObject

Returns the value of attribute date_record.



26
27
28
# File 'lib/gedcom/change_date_record.rb', line 26

def date_record
  @date_record
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



26
27
28
# File 'lib/gedcom/change_date_record.rb', line 26

def note_citation_record
  @note_citation_record
end