Class: TrueandcoAnalytics::Database::GetCurrentConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/trueandco_analytics/console/commands/database/get_current_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(current_mode, path) ⇒ GetCurrentConfig

Returns a new instance of GetCurrentConfig.



4
5
6
7
# File 'lib/trueandco_analytics/console/commands/database/get_current_config.rb', line 4

def initialize(current_mode, path)
  @current_mode = current_mode
  @path = path
end

Instance Method Details

#executeObject



9
10
11
12
13
14
# File 'lib/trueandco_analytics/console/commands/database/get_current_config.rb', line 9

def execute
  config = YAML.load_file(path)
  config[current_mode]
rescue StandardError => e
  return nil
end