Class: CaTissue::Annotation::IntegrationService

Inherits:
CaRuby::PersistenceService
  • Object
show all
Defined in:
lib/catissue/database/annotation/integration_service.rb

Overview

An IntegrationService fetches and saves CaTissue 1.1.x hook-annotation associations.

Instance Method Summary collapse

Constructor Details

#initializeIntegrationService

Returns a new instance of IntegrationService.



12
13
14
# File 'lib/catissue/database/annotation/integration_service.rb', line 12

def initialize
  super(SVC_NAME, CaTissue::Database.current.access_properties)
end

Instance Method Details

#associate(hook, annotation) ⇒ Object

Associates the given hook domain object to the annotation.

Parameters:



20
21
22
23
24
25
26
27
# File 'lib/catissue/database/annotation/integration_service.rb', line 20

def associate(hook, annotation)
  # the annotation must have an identifier
  if annotation.identifier.nil? then
    raise CaRuby::DatabaseError.new("Annotation to associate does not have an identifier: #{annotation}")
  end
  emr = create_entity_map_record(hook, annotation)
  create(emr)
end