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



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