1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Merge pull request #264 from derekprior/dp-modern-respond-to

Modernize respond_to implementations
This commit is contained in:
John Nunemaker 2014-01-06 14:46:27 -08:00
commit b48cc4ace6
2 changed files with 4 additions and 4 deletions

View file

@ -50,9 +50,9 @@ module HTTParty
alias_method :multiple_choice?, :multiple_choices?
end
def respond_to?(name)
def respond_to?(name, include_all = false)
return true if [:request, :response, :parsed_response, :body, :headers].include?(name)
parsed_response.respond_to?(name) || response.respond_to?(name)
parsed_response.respond_to?(name, include_all) || response.respond_to?(name, include_all)
end
protected

View file

@ -23,8 +23,8 @@ module HTTParty
end
end
def respond_to?(method)
super || @header.respond_to?(method)
def respond_to?(method, include_all = false)
super || @header.respond_to?(method, include_all)
end
end
end