Class: Patriarch::DAOServices::RetrieverService

Inherits:
Service
  • Object
show all
Defined in:
lib/patriarch/dao_services/retriever_service.rb

Overview

Services managing transactions must not know how the database layer is structured. We thus provide DAO through this RetrieverService and let them know about the interface of the DAOs

Instance Method Summary collapse

Instance Method Details

#call(transaction_item) ⇒ Hash

Only public method of this service, does the work of retrieving DAOs for a given transaction step

Parameters:

Returns:

  • (Hash)

    hash containing DAOs for RelationshipBuilderServices to toy with



13
14
15
16
17
18
19
20
21
# File 'lib/patriarch/dao_services/retriever_service.rb', line 13

def call(transaction_item)
  result = {}
  result[:actor]  = instantiate_DAO_for_actor(transaction_item)
  result[:target] = instantiate_DAO_for_target(transaction_item)
  if transaction_item.tripartite?
    result[:medium] = instantiate_DAO_for_medium(transaction_item)
  end
  result
end