Class: Realm::Config

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/realm/config.rb

Instance Method Summary collapse

Instance Method Details

#persistence_gatewayObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/realm/config.rb', line 30

def persistence_gateway
  return {} unless @persistence_gateway

  class_path = engine_path && "#{engine_path}/app/persistence/#{namespace}"
  repos_path = class_path && "#{class_path}/repositories"
  repos_module = "#{root_module}::Repositories"
  {
    root_module: root_module,
    class_path: class_path,
    repos_path: repos_path,
    repos_module: repos_module,
    migration_path: engine_path && "#{engine_path}/db/migrate",
    repositories: repositories(repos_path, repos_module),
  }.merge(@persistence_gateway)
end

#pluginsObject



26
27
28
# File 'lib/realm/config.rb', line 26

def plugins
  Array(@plugins)
end