Class: Note_record

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

Overview

Internal representation of the GEDCOM NOTE record type Both inline and level 0 NOTEs are stored here and both are referenced through the Note_citation_record class. NOTES are also used to store user defined tags, so can appear in places the GEDCOM standard doesn't specify NOTEs.

=NOTE_RECORD:= 0 @<XREF:NOTE>@ NOTE <SUBMITTER_TEXT> 0:M +1 [ CONC | CONT] <SUBMITTER_TEXT> 0:M +1 <<SOURCE_CITATION>> 0:M +1 REFN <USER_REFERENCE_NUMBER> 0:M +2 TYPE <USER_REFERENCE_TYPE> 0:1 +1 RIN <AUTOMATED_RECORD_ID> 0:1 +1 <<CHANGE_DATE>> 0:1

I also recognise notes in this record, so I can handle user tags as notes. +1 <<NOTE_STRUCTURE>> 0:M

=NOTE_STRUCTURE:= (The inline NOTE, defined in NOTE_STRUCTURE is also stored here) n NOTE [SUBMITTER_TEXT> | <NULL>] 1:1 p.51 +1 [ CONC | CONT ] <SUBMITTER_TEXT> 0:M +1 <<SOURCE_CITATION>> 0:M

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 the NOTE records.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from GEDCOMBase

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

Constructor Details

This class inherits a constructor from GEDCOMBase

Instance Attribute Details

#automated_record_idObject

Returns the value of attribute automated_record_id.



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

def automated_record_id
  @automated_record_id
end

#change_date_recordObject

Returns the value of attribute change_date_record.



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

def change_date_record
  @change_date_record
end

#noteObject

Returns the value of attribute note.



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

def note
  @note
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



31
32
33
# File 'lib/gedcom/note_record.rb', line 31

def note_citation_record
  @note_citation_record
end

#note_refObject

Returns the value of attribute note_ref.



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

def note_ref
  @note_ref
end

#refn_recordObject

Returns the value of attribute refn_record.



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

def refn_record
  @refn_record
end

#restrictionObject

Returns the value of attribute restriction.



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

def restriction
  @restriction
end

#source_citation_recordObject

Returns the value of attribute source_citation_record.



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

def source_citation_record
  @source_citation_record
end

Instance Method Details

#to_gedcom(level = 0) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/gedcom/note_record.rb', line 35

def to_gedcom(level=0)
  if @note_ref != nil
    @this_level = [ [:xref, "NOTE", :note_ref] ]
    @sub_level =  [ #level + 1
                    [:conc, "CONC", :note],
                    [:print, "RESN", :restriction ],
                    [:walk, nil,    :source_citation_record ],
                    [:walk, nil,    :note_citation_record ],
                    [:walk, nil, :refn_record ],
                    [:print, "RIN",  :automated_record_id ],
                    [:walk, nil,    :change_date_record],
                  ] 
  else
    @this_level = [ [:cont, "NOTE", :note] ]
    @sub_level =  [ #level + 1
                    [:print, "RESN", :restriction ],
                    [:walk, nil,    :source_citation_record ],
                    [:walk, nil,    :note_citation_record ],
                    [:walk, nil, :refn_record ],
                    [:print, "RIN",  :automated_record_id ],
                    [:walk, nil,    :change_date_record],
                  ]
  end
  super(level)
end