Class: Interscript::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/interscript/mapping.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(system_code, options = {}) ⇒ Mapping

Returns a new instance of Mapping.



35
36
37
38
39
40
41
# File 'lib/interscript/mapping.rb', line 35

def initialize(system_code, options = {})
  @system_code = system_code
  @depth = options.fetch(:depth, 0).to_i
  @system_path = options.fetch(:system_code, default_path)

  load_and_serialize_system_mappings
end

Instance Attribute Details

#authority_idObject (readonly)

Returns the value of attribute authority_id.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def authority_id
  @authority_id
end

#chainObject (readonly)

Returns the value of attribute chain.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def chain
  @chain
end

#character_separatorObject (readonly)

Returns the value of attribute character_separator.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def character_separator
  @character_separator
end

#charactersObject (readonly)

Returns the value of attribute characters.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def characters
  @characters
end

#characters_hashObject (readonly)

Returns the value of attribute characters_hash.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def characters_hash
  @characters_hash
end

#creation_dateObject (readonly)

Returns the value of attribute creation_date.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def creation_date
  @creation_date
end

#descriptionObject (readonly)

Returns the value of attribute description.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def description
  @description
end

#destination_scriptObject (readonly)

Returns the value of attribute destination_script.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def destination_script
  @destination_script
end

#dictionaryObject (readonly)

Returns the value of attribute dictionary.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def dictionary
  @dictionary
end

#dictionary_hashObject (readonly)

Returns the value of attribute dictionary_hash.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def dictionary_hash
  @dictionary_hash
end

#dictionary_trieObject (readonly)

Returns the value of attribute dictionary_trie.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def dictionary_trie
  @dictionary_trie
end

#downcaseObject (readonly)

Returns the value of attribute downcase.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def downcase
  @downcase
end

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def id
  @id
end

#languageObject (readonly)

Returns the value of attribute language.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def language
  @language
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def name
  @name
end

#notesObject (readonly)

Returns the value of attribute notes.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def notes
  @notes
end

#postrulesObject (readonly)

Returns the value of attribute postrules.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def postrules
  @postrules
end

#rulesObject (readonly)

Returns the value of attribute rules.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def rules
  @rules
end

#segmentationObject (readonly)

Returns the value of attribute segmentation.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def segmentation
  @segmentation
end

#source_scriptObject (readonly)

Returns the value of attribute source_script.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def source_script
  @source_script
end

#testsObject (readonly)

Returns the value of attribute tests.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def tests
  @tests
end

#title_caseObject (readonly)

Returns the value of attribute title_case.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def title_case
  @title_case
end

#transcriptionObject (readonly)

Returns the value of attribute transcription.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def transcription
  @transcription
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def url
  @url
end

#word_separatorObject (readonly)

Returns the value of attribute word_separator.



7
8
9
# File 'lib/interscript/mapping.rb', line 7

def word_separator
  @word_separator
end

Class Method Details

.for(system_code, options = {}) ⇒ Object



43
44
45
# File 'lib/interscript/mapping.rb', line 43

def self.for(system_code, options = {})
  new(system_code, options)
end

Instance Method Details

#load_and_serialize_system_mappingsObject



47
48
49
50
51
52
# File 'lib/interscript/mapping.rb', line 47

def load_and_serialize_system_mappings
  if depth < 5
    mappings = load_system_mappings
    serialize_system_mappings(mappings)
  end
end