Closed jonaldomo closed 7 years ago
@jonaldomo Thanks for reporting this. I can confirm that using a block does not allow you override either of those values:
[1] pry(main)> require 'validic'
=> true
[2] pry(main)> Validic.configure { |c| c.access_token = 'abc'; c.organization_id = '123'; c.api_url = 'https://something.org' }
=> true
[3] pry(main)> Validic::Client.new
=> #<Validic::Client:0x007fa4fa874be0 @access_token="abc", @api_url="https://api.validic.com", @api_version="v1", @organization_id="123">
We made the .configure
method for convenience but thinking through this more and seeing other issues (like PR #27), I think we have confused users of the gem more than helped.
api_url and api_version are not recognized when using configure.
they are however when passing options into the client constructor. i am writing a mock validic service for testing and would like to override the api_url with the configure method in an initializer.
so this would override the api_url and api_version:
but this would not, even though the docs would imply it would. additionally, it is how i would prefer to configure it.