Class: Character_set_record

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

Overview

Character_set_record is part of the HEAD record, and names the the character set used in this transmission.

=HEADER:= 0 HEAD 1:1 … 1 CHAR <CHARACTER_SET> 1:1 +1 VERS <VERSION_NUMBER> 0:1 …

==CHARACTER_SET:= Size=1:8 ANSEL | UNICODE | ASCII

A code value that represents the character set to be used to interpret this data. The default character set is ANSEL, which includes ASCII as a subset.

Note:: The IBMPC character set is not allowed. This character set cannot be interpreted properly without knowing which code page the sender was using.

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) ⇒ Character_set_record

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



33
34
35
36
37
38
39
40
# File 'lib/gedcom/character_set_record.rb', line 33

def initialize(*a)
  super(*a)
  @this_level = [ [:print, "CHAR", :char_set_id] ]
  @sub_level =  [ #level + 1
                  [:print, "VERS", :version],
                  [:walk, nil,    :note_citation_record]
                ]
end

Instance Attribute Details

#char_set_idObject

Returns the value of attribute char_set_id.



27
28
29
# File 'lib/gedcom/character_set_record.rb', line 27

def char_set_id
  @char_set_id
end

#note_citation_recordObject

Returns the value of attribute note_citation_record.



28
29
30
# File 'lib/gedcom/character_set_record.rb', line 28

def note_citation_record
  @note_citation_record
end

#versionObject

Returns the value of attribute version.



27
28
29
# File 'lib/gedcom/character_set_record.rb', line 27

def version
  @version
end