lib/gedcom/source_record.rb
def to_gedcom(level=0)
    if @source_ref != nil
      @this_level = [ [:xref, "SOUR", :source_ref] ]
      @sub_level =  [ #level + 1
                      [:print, "ABBR", :short_title],
                      [:cont, "TITL", :title],
                      [:cont, "AUTH", :author],
                      [:cont, "PUBL", :publication_details],
                      [:walk, nil,  :repository_citation_record],
                      [:walk, nil, :text_record],
                      [:walk, nil, :multimedia_citation_record],
                      [:walk, nil, :source_scope_record],
                      [:walk, nil, :note_citation_record],
                      [:walk, nil, :refn_record],
                      [:print, "RIN", :automated_record_id],
                      [:walk,  nil, :change_date_record],
                    ]
    else
      @this_level = [ [:cont, "SOUR", :title] ]
      @sub_level =  [ #level + 1
                      [:walk, nil, :text_record],
                      [:walk, nil, :note_citation_record] ,
                    ] 
    end
    super(level)
  end
#to_gedcom sets up the state engine arrays @this_level and @sub_level, which drive the parent class to_gedcom method generating GEDCOM output.
#There are two types of SOUR record, inline and reference, so this is done dynamically in to_gedcom rather than the initialize method.
#Probably should be two classes, rather than this conditional.
to_gedcom sets up the state engine arrays @this_level and @sub_level, which drive the parent class to_gedcom method generating GEDCOM output.
There are two types of SOUR record, inline and reference, so this is done dynamically in to_gedcom rather than the initialize method.
Probably should be two classes, rather than this conditional.
to_gedcom sets up the state engine arrays @this_level and @sub_level which drive the parent class to_gedcom method generating GEDCOM output . There are two types of SOUR record inline and reference so this is done dynamically in to_gedcom rather than the initialize method . Probably should be two classes rather than this conditional .
def to_gedcom(level=0)
    if @source_ref != nil
      @this_level = [ [:xref, "SOUR", :source_ref] ]
      @sub_level =  [ 
                      [:print, "ABBR", :short_title],
                      [:cont, "TITL", :title],
                      [:cont, "AUTH", :author],
                      [:cont, "PUBL", :publication_details],
                      [:walk, nil,  :repository_citation_record],
                      [:walk, nil, :text_record],
                      [:walk, nil, :multimedia_citation_record],
                      [:walk, nil, :source_scope_record],
                      [:walk, nil, :note_citation_record],
                      [:walk, nil, :refn_record],
                      [:print, "RIN", :automated_record_id],
                      [:walk,  nil, :change_date_record],
                    ]
    else
      @this_level = [ [:cont, "SOUR", :title] ]
      @sub_level =  [ 
                      [:walk, nil, :text_record],
                      [:walk, nil, :note_citation_record] ,
                    ] 
    end
    super(level)
  end
def to_gedcom ( level = 0 ) if @source_ref != nil @this_level = [ [ :xref , "SOUR" , :source_ref ] ] @sub_level = [ [ :print , "ABBR" , :short_title ] , [ :cont , "TITL" , :title ] , [ :cont , "AUTH" , :author ] , [ :cont , "PUBL" , :publication_details ] , [ :walk , nil , :repository_citation_record ] , [ :walk , nil , :text_record ] , [ :walk , nil , :multimedia_citation_record ] , [ :walk , nil , :source_scope_record ] , [ :walk , nil , :note_citation_record ] , [ :walk , nil , :refn_record ] , [ :print , "RIN" , :automated_record_id ] , [ :walk , nil , :change_date_record ] , ] else @this_level = [ [ :cont , "SOUR" , :title ] ] @sub_level = [ [ :walk , nil , :text_record ] , [ :walk , nil , :note_citation_record ] , ] end super ( level ) end
to_gedcom sets up the state engine arrays @this_level and @sub_level, which drive the parent class to_gedcom method generating GEDCOM output.
to_gedcom sets up the state engine arrays @this_level and @sub_level which drive the parent class to_gedcom method generating GEDCOM output .
#level + 1 #level + 1
level