Closed gerbal closed 2 weeks ago
Hrm, I'm not sure what to make of this - can you demonstrate the problem you are solving here? Maybe there's a test we can add to solidify this usage? 🤔
Prior to this change, values set by BrazeRuby.configure
are never used. Instead the configuration is required to be passed at every invocation of BrazeRuby::API.new/3
. It is my assumption, that if the Braze API key and URL are set in configuration, we should not have to pass the api key and url as arguments to Braze::API.new
.
For example, prior to this change, the following usage is not valid
BrazeRuby.configure do |config|
config.rest_api_key = "test"
config.rest_url = "https://rest.iad-03.braze.com"
end
# why do I need to pass already-set configuration variable to instantiate the API?
> BrazeRuby::API.new()
ArgumentError: wrong number of arguments (given 0, expected 2..3)
@jonallured can we merge this? Thanks!
@jonallured it would be wonderful if you could merge this or https://github.com/jonallured/braze_ruby/pull/59 - I'm sure there are many others using your gem to conform to the new unsubscribe rules.
Closing this one in favor of #64 - thank you again to @gerbal for this PR and for all your patience. 😬
This change fixes using this library with the configuration initializer pattern documented in the configuration