Class: ODDB::Registration

Inherits:
RegistrationCommon show all
Includes:
OddbYaml
Defined in:
ext/export/src/oddb_yaml.rb,
src/model/registration.rb,
test/test_util/oddbapp.rb

Overview

< RegistrationCommon

Constant Summary

ODBA_PREFETCH =
true
EXPORT_PROPERTIES =
[
  '@iksnr',
  '@registration_date',
  '@revision_date',
  '@expiration_date',
  '@inactive_date',
  '@sequences',
  '@indication',
  '@export_flag',
]

Constants included from OddbYaml

EXPORT_PROPERTIES, YAML_URI

Constants inherited from RegistrationCommon

SEQUENCE

Constants included from Persistence

ODBA_PREDEFINE_SERIALIZABLE

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from OddbYaml

#to_yaml_properties, #to_yaml_type

Methods inherited from RegistrationCommon

#active?, #active_package_count, #active_packages, #adjust_types, #atc_classes, #atcless_sequences, #checkout, #company_name, #compositions, #create_patent, #create_sequence, #delete_patent, #delete_sequence, #each_package, #each_sequence, #expired?, #fachinfo_active?, #generic?, #has_fachinfo?, #ignore_patent?, #inactive?, #initialize, #limitation_text_count, #localized_name, #may_violate_patent?, #name_base, #original?, #out_of_trade, #package, #package_count, #packages, #patent_protected?, #public?, #public_package_count, #sequence, #substance_names

Methods included from Persistence

#initialize

Methods included from PersistenceMethods

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

Constructor Details

This class inherits a constructor from ODDB::RegistrationCommon

Instance Attribute Details

- (Object) sequences=(value) (writeonly)

Sets the attribute sequences

Parameters:

  • value

    the value to set the attribute sequences to.



36
37
38
# File 'test/test_util/oddbapp.rb', line 36

def sequences=(value)
  @sequences = value
end

Instance Method Details

- (Object) company=(company)



246
247
248
# File 'src/model/registration.rb', line 246

def company=(company)
  @company = replace_observer(@company, company)
end

- (Object) fachinfo=(fachinfo)



252
253
254
# File 'src/model/registration.rb', line 252

def fachinfo=(fachinfo)
  @fachinfo = replace_observer(@fachinfo, fachinfo)
end

- (Object) indication=(indication)



249
250
251
# File 'src/model/registration.rb', line 249

def indication=(indication)
  @indication = replace_observer(@indication,indication)
end

- (Object) minifi=(minifi)



255
256
257
# File 'src/model/registration.rb', line 255

def minifi=(minifi)
  @minifi = replace_observer(@minifi, minifi)
end

- (Object) replace_observer(target, value)



258
259
260
261
262
263
264
265
266
# File 'src/model/registration.rb', line 258

def replace_observer(target, value)
  if(target.respond_to?(:remove_registration))
    target.remove_registration(self)
  end
  if(value.respond_to?(:add_registration))
    value.add_registration(self)
  end
  target = value
end

- (Object) to_yaml(opts = {})



462
463
464
465
466
467
468
469
470
471
472
473
474
475
# File 'ext/export/src/oddb_yaml.rb', line 462

def to_yaml( opts = {} )
  YAML::quick_emit( self.object_id, opts ) { |out|
    out.map( taguri ) { |map|
      to_yaml_properties.each { |m|
        map.add( m[1..-1], instance_variable_get( m ) )
      }
      if @fachinfo
        map.add('fachinfo_oid', @fachinfo.oid)
      end
      map.add('generic_type', self.generic_type)
      map.add('complementary_type', self.complementary_type)
    }
  }
end