class FacebookAds::Test::Config

Public Instance Methods

override_from!(filename = nil) click to toggle source
# 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