Class: CaTissue::Annotator

Inherits:
Object
  • Object
show all
Defined in:
lib/catissue/database/annotation/annotator.rb

Overview

An Annotator creates annotation services for annotatable and annotation classes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ Annotator

Initializes a new Annotator for the given database.

Parameters:



13
14
15
# File 'lib/catissue/database/annotation/annotator.rb', line 13

def initialize(database)
  @database = database
end

Instance Attribute Details

#integratorObject (readonly)

Returns the value of attribute integrator.



8
9
10
# File 'lib/catissue/database/annotation/annotator.rb', line 8

def integrator
  @integrator
end

Instance Method Details

#create_annotation_service(mod, name) ⇒ Annotation::AnnotationService

Returns the annotation service.

Parameters:

  • the (Module)

    annotation module

  • name (String)

    the service name

Returns:



20
21
22
23
# File 'lib/catissue/database/annotation/annotator.rb', line 20

def create_annotation_service(mod, name)
  @integrator = Annotation::Integrator.new(mod)
  Annotation::AnnotationService.new(@database, name, @integrator)
end