Module: ODDB::Language

Includes:
SimpleLanguage
Included in:
Language, AtcClass, CommercialForm, Fachinfo, GalenicForm, GalenicGroup, Indication, MiniFi, OrphanedTextInfo, Patinfo, State::Admin::TestTransparentLoginState::StubGalenicGroup, State::Drugs::TestGalenicForm::StubGalenicForm, State::Drugs::TestGalenicGroup::StubGalenicForm, State::TestGlobal::StubGalenicForm, Substance, TestOddbApp::StubGalenicForm, TestOddbApp::StubIndication
Defined in:
src/util/language.rb

Defined Under Namespace

Classes: Descriptions

Constant Summary

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Instance Method Summary (collapse)

Methods included from SimpleLanguage

#description, #descriptions, #match, #method_missing, #respond_to?, #search_text, #to_s, #update_values

Methods included from Persistence

#initialize

Methods included from PersistenceMethods

#checkout, #data_origin, #data_origins, #diff, #nil_if_empty, #parent, #pointer_descr, #structural_ancestors, #undiffable?, #update_values

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ODDB::SimpleLanguage

Instance Method Details

- (Object) all_descriptions



83
84
85
# File 'src/util/language.rb', line 83

def all_descriptions
  self.synonyms + self.descriptions.values
end

- (Boolean) has_description?(descr)

Returns:

  • (Boolean)


86
87
88
# File 'src/util/language.rb', line 86

def has_description?(descr)
  super || (@synonyms.is_a?(Array) && @synonyms.include?(descr))
end

- (Object) init(app = nil)



76
77
78
79
80
81
82
# File 'src/util/language.rb', line 76

def init(app=nil)
  super
  unless(@pointer.last_step.size > 1)
    @pointer.append(@oid) 
  end
  @pointer
end

- (Object) synonyms



89
90
91
# File 'src/util/language.rb', line 89

def synonyms
  @synonyms ||= []
end

- (Object) synonyms=(syns)



92
93
94
# File 'src/util/language.rb', line 92

def synonyms=(syns)
  @synonyms = syns.compact.delete_if { |syn| syn.empty?  }
end