Class: Synapse::ProcessManager::Mongo::Template

Inherits:
Common::Mongo::BaseTemplate show all
Defined in:
lib/synapse/process_manager/mongo/template.rb

Overview

Template for accessing collections needed by the process repository

Instance Attribute Summary collapse

Attributes inherited from Common::Mongo::BaseTemplate

#database_name, #password, #username

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ undefined

Parameters:

  • client (Mongo::MongoClient)


11
12
13
14
# File 'lib/synapse/process_manager/mongo/template.rb', line 11

def initialize(client)
  super
  @process_repository_name = 'processes'
end

Instance Attribute Details

#process_repository_nameString

Returns Name of the collection containing processes.

Returns:

  • (String)

    Name of the collection containing processes



7
8
9
# File 'lib/synapse/process_manager/mongo/template.rb', line 7

def process_repository_name
  @process_repository_name
end

Instance Method Details

#process_collectionMongo::Collection

Returns:

  • (Mongo::Collection)


17
18
19
# File 'lib/synapse/process_manager/mongo/template.rb', line 17

def process_collection
  database.collection @process_repository_name
end