Class: ODDB::Drugs::Product
- Defined in:
- lib/oddb/export/yaml.rb,
lib/oddb/drugs/product.rb,
lib/oddb/persistence/og/drugs/product.rb,
lib/oddb/persistence/odba/drugs/product.rb
Constant Summary
Constants included from OddbUri
Instance Method Summary collapse
- #atcs ⇒ Object
-
#initialize ⇒ Product
constructor
A new instance of Product.
- #packages ⇒ Object
Methods inherited from Model
#__odba_delete__, #__odba_save__, _serializables, belongs_to, connections, connector, connectors, #data_origin, #data_origins, delegates, #delete, find_by_uid, has_many, is_coded, m10l_document, multilingual, #odba_serializables, #oid, on_delete, on_save, predicates, #save, #saved?, serializables, serialize, singular
Methods included from ODBA::Persistable
Methods included from Yaml
append_features, #to_yaml_properties
Methods included from OddbUri
#to_yaml, #to_yaml_map, #to_yaml_type
Constructor Details
#initialize ⇒ Product
Returns a new instance of Product.
12 13 14 |
# File 'lib/oddb/drugs/product.rb', line 12 def initialize @sequences = [] end |
Instance Method Details
#atcs ⇒ Object
15 16 17 |
# File 'lib/oddb/drugs/product.rb', line 15 def atcs sequences.collect { |sequence| sequence.atc }.compact.uniq end |
#packages ⇒ Object
18 19 20 21 22 |
# File 'lib/oddb/drugs/product.rb', line 18 def packages sequences.inject([]) { |memo, seq| memo.concat(seq.packages) } end |