Class: GammaReplication::DatabaseSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/gamma_replication/database_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml_path) ⇒ DatabaseSettings

Returns a new instance of DatabaseSettings.



7
8
9
10
11
12
# File 'lib/gamma_replication/database_settings.rb', line 7

def initialize(yaml_path)
  @settings = YAML.safe_load_file(yaml_path, permitted_classes: [Symbol, Hash],
                                             symbolize_names: true).with_indifferent_access
  @in_database = @settings[:in_database_config]
  @out_database = @settings[:out_database_config]
end

Instance Attribute Details

#in_databaseObject (readonly)

Returns the value of attribute in_database.



5
6
7
# File 'lib/gamma_replication/database_settings.rb', line 5

def in_database
  @in_database
end

#out_databaseObject (readonly)

Returns the value of attribute out_database.



5
6
7
# File 'lib/gamma_replication/database_settings.rb', line 5

def out_database
  @out_database
end

#settingsObject (readonly)

Returns the value of attribute settings.



5
6
7
# File 'lib/gamma_replication/database_settings.rb', line 5

def settings
  @settings
end

Instance Method Details

#in_database_configObject



14
15
16
# File 'lib/gamma_replication/database_settings.rb', line 14

def in_database_config
  @in_database
end

#out_database_configObject



18
19
20
# File 'lib/gamma_replication/database_settings.rb', line 18

def out_database_config
  @out_database
end