Method: FacebookAds::Test::Config#override_from!

Defined in:
lib/facebook_ads/test/config.rb

#override_from!(filename = nil) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/facebook_ads/test/config.rb', line 42

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

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