Class: FacebookAds::Test::Config

Inherits:
Config
  • Object
show all
Defined in:
lib/facebook_ads/test/config.rb

Instance Method Summary collapse

Methods inherited from Config

#logger=, setting

Instance Method Details

#override_from!(filename = nil) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/facebook_ads/test/config.rb', line 30

def override_from!(filename = nil)
  filename ||= File.expand_path("../../../../tests/test_config.json", __FILE__)
  if File.exist?(filename)
    settings = JSON.parse(File.read(filename))

    settings.each do |k,v|
      instance_variable_set("@#{k}", v)
    end
  end
  self
end