Class: Note_citation_record

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

Overview

Internal representation of a reference to a GEDCOM NOTE_STRUCTURE, or reference to a Level 0 NOTE. NOTE types can be inline, references to Level 0 NOTEs, or used to store user defined tags. All NOTES are stored in the Note_record closs and referenced through this class.

=NOTE_STRUCTURE:= n NOTE @<XREF:NOTE>@ 1:1 +1 <<SOURCE_CITATION>> 0:M

The inline NOTE, also described as a NOTE_STRUCTURE in the GEDCOM standard, is stored in a Note_record.

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, #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

#note_recordObject

Returns the value of attribute note_record.



18
19
20
# File 'lib/gedcom/note_citation_record.rb', line 18

def note_record
  @note_record
end

#note_refObject

Returns the value of attribute note_ref.



18
19
20
# File 'lib/gedcom/note_citation_record.rb', line 18

def note_ref
  @note_ref
end

#source_citation_recordObject

Returns the value of attribute source_citation_record.



18
19
20
# File 'lib/gedcom/note_citation_record.rb', line 18

def source_citation_record
  @source_citation_record
end

Instance Method Details

#to_gedcom(level = 0) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gedcom/note_citation_record.rb', line 22

def to_gedcom(level=0)
  if @note_ref != nil
    @this_level = [ [:xref, "NOTE", :note_ref] ]
    @sub_level =  [#level 1
                    [:walk, nil,    :source_citation_record ],
                    [:walk, nil, :note_record] 
                  ]
  else
    @this_level = [ [:walk, nil, :note_record] ]
    @sub_level =  [#level 1
                  ]
  end
  super(level)
end