Class: ODDB::Narcotic
- Includes:
- OddbYaml
- Defined in:
- ext/export/src/oddb_yaml.rb
Constant Summary collapse
- EXPORT_PROPERTIES =
[ '@oid', '@substances', ]
Constants included from OddbYaml
Instance Method Summary collapse
Methods included from OddbYaml
#to_yaml_properties, #to_yaml_type
Instance Method Details
#to_yaml(opts = {}) ⇒ Object
336 337 338 339 340 341 342 343 344 345 346 |
# File 'ext/export/src/oddb_yaml.rb', line 336 def to_yaml( opts = {} ) YAML::quick_emit( self.object_id, opts ) { |out| out.map( taguri ) { |map| map.add('casrn', casrn) to_yaml_properties.each { |m| map.add( m[1..-1], instance_variable_get( m ) ) } map.add('packages', @packages.collect { |pac| pac.ikskey }) } } end |