Closed coreyward closed 9 years ago
@coreyward , can you give full steps for reproduce it ? ( Write here full example, which doesn't work )
basic_auth
on Base
, e.g. Base.default_options.merge! basic_auth: { ... }
. class Lead < Base
default_options
on subclass, e.g. Lead.default_options
. The default options should follow, but do not.
@coreyward , I test it, but it works:
require './lib/httparty'
# first example
class Yandex
include HTTParty
basic_auth 'rusik', '123'
end
class YandexMoney < Yandex
end
p Yandex.default_options
p YandexMoney.default_options
p Yandex.default_options == YandexMoney.default_options
# second example
class Google
include HTTParty
end
Google.default_options.merge! basic_auth: {username: 'john', password: '123'}
class GoogleWallet < Google
end
p Google.default_options
p GoogleWallet.default_options
p Google.default_options == GoogleWallet.default_options
Output:
/httparty$ pry fun.rb
{:basic_auth=>{:username=>"rusik", :password=>"123"}}
{:basic_auth=>{:username=>"rusik", :password=>"123"}}
true
{:basic_auth=>{:username=>"john", :password=>"123"}}
{:basic_auth=>{:username=>"john", :password=>"123"}}
true
ruslan@rs3:~/Work/httparty-fun/httparty$ pry fun.rb
{:basic_auth=>{:username=>"rusik", :password=>"123"}}
{:basic_auth=>{:username=>"rusik", :password=>"123"}}
true
{:basic_auth=>{:username=>"john", :password=>"123"}}
{:basic_auth=>{:username=>"john", :password=>"123"}}
true
@jnunemaker, what you think about it ?
I guess closing until we get something repeatable to prove there is an issue.
Hmm, I wonder if it isn't a version issue, or perhaps because CloseIO inherits from OpenStruct.
Similar to #83. Setting
basic_auth
in aBase
class and inheriting from it in subclasses does not work. Issue exists in Closeio library:Using v0.13.0.