Class: Place_record

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

Overview

Internal representation of the GEDCOM PLAC record type. Sub-record of HEAD and EVENT

=PLACE_STRUCTURE:= n PLAC <PLACE_VALUE> 1:1 +1 FORM <PLACE_HIERARCHY> 0:1 +1 <<SOURCE_CITATION>> 0:M +1 <<NOTE_STRUCTURE>> 0:M

==PLACE_VALUE:= Size=1:120

<TEXT> | <TEXT>, <PLACE_VALUE>

The jurisdictional name of the place where the event took place. Jurisdictions are separated by commas, for example, “Cove, Cache, Utah, USA.” If the actual jurisdictional names of these places have been identified, they can be shown using a PLAC.FORM structure either in the HEADER or in the event structure. (See <PLACE_HIERARCHY>, page 47.)

The attributes are all arrays for the level +1 tags/records. * Those ending in _record are array of classes of that type. * The remainder are arrays of attributes that could be present in the PLAC records.

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_citation_recordObject

Returns the value of attribute note_citation_record.



25
26
27
# File 'lib/gedcom/place_record.rb', line 25

def note_citation_record
  @note_citation_record
end

#place_hierachyObject

Returns the value of attribute place_hierachy.



24
25
26
# File 'lib/gedcom/place_record.rb', line 24

def place_hierachy
  @place_hierachy
end

#place_valueObject

Returns the value of attribute place_value.



24
25
26
# File 'lib/gedcom/place_record.rb', line 24

def place_value
  @place_value
end

#placename_map_recordObject

Returns the value of attribute placename_map_record.



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

def placename_map_record
  @placename_map_record
end

#placename_phonetic_recordObject

Returns the value of attribute placename_phonetic_record.



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

def placename_phonetic_record
  @placename_phonetic_record
end

#placename_romanized_recordObject

Returns the value of attribute placename_romanized_record.



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

def placename_romanized_record
  @placename_romanized_record
end

#source_citation_recordObject

Returns the value of attribute source_citation_record.



25
26
27
# File 'lib/gedcom/place_record.rb', line 25

def source_citation_record
  @source_citation_record
end

Instance Method Details

#placeObject

When wanting just one place, the GEDCOM standard says to use the first PLAC record. If you want all the PLAC records, then use @place_value, which is an array PLAC's.



57
58
59
# File 'lib/gedcom/place_record.rb', line 57

def place
  @place_value ?  @place_value.first : ''
end

#to_gedcom(level = 0) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/gedcom/place_record.rb', line 30

def to_gedcom(level=0)
  if @place_value != nil
    @this_level = [  [:print, "PLAC", :place_value] ]
    @sub_level =  [ #level + 1
                    [:print, "FORM", :place_hierachy],
                    [:print, "FONE", :placename_phonetic_record],
                    [:print, "ROMN", :placename_romanized_record],
                    [:print, "MAP", :placename_map_record],
                    [:walk, nil,    :source_citation_record],
                    [:walk, nil,    :note_citation_record],
                  ]
  else
    @this_level = [  [:nodata, "PLAC", nil] ]
    @sub_level =  [ #level + 1
                    [:print, "FORM", :place_hierachy],
                    [:print, "FONE", :placename_phonetic_record],
                    [:print, "ROMN", :placename_romanized_record],
                    [:print, "MAP", :placename_map_record],
                    [:walk, nil,    :source_citation_record],
                    [:walk, nil,    :note_citation_record],
                  ]
  end
  super(level)
end