Class: ODDB::CommercialForm

Inherits:
Object show all
Includes:
ODBA::Persistable, Language, OddbYaml, PackageObserver
Defined in:
ext/export/src/oddb_yaml.rb,
src/model/commercial_form.rb

Constant Summary

EXPORT_PROPERTIES =
[
  '@oid',
  '@descriptions',
]
ODBA_SERIALIZABLE =
[ '@descriptions', '@synonyms' ]

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Constants included from OddbYaml

EXPORT_PROPERTIES, YAML_URI

Instance Method Summary (collapse)

Methods included from PackageObserver

#add_package, #empty?, #initialize, #package_count, #remove_package

Methods included from Language

#all_descriptions, #has_description?, #synonyms, #synonyms=

Methods included from SimpleLanguage

#description, #descriptions, #has_description?, #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

Methods included from OddbYaml

#to_yaml_properties, #to_yaml_type

Constructor Details

This class inherits a constructor from ODDB::PackageObserver

Dynamic Method Handling

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

Instance Method Details

- (Object) init(app)



14
15
16
# File 'src/model/commercial_form.rb', line 14

def init(app)
  @pointer.append(@oid)
end

- (Object) merge(other)



17
18
19
20
21
22
23
24
25
26
27
28
# File 'src/model/commercial_form.rb', line 17

def merge(other)
  other.packages.dup.each { |pac|
    pac.parts.each { |part|
      if part.commercial_form == other
        part.commercial_form = self
        part.odba_isolated_store
      end
    }
    pac.odba_isolated_store
  }
  self.synonyms += other.all_descriptions - self.all_descriptions
end