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

fix BasicObject

This commit is contained in:
Ruslan Korolev 2014-12-01 18:59:51 +03:00
parent 7272eae66e
commit 9a27bf96ed
2 changed files with 1 additions and 9 deletions

View file

@ -1,12 +1,4 @@
module HTTParty
if defined?(::BasicObject)
BasicObject = ::BasicObject #:nodoc:
else
class BasicObject #:nodoc:
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval/ }
end
end
unless defined?(Net::HTTP::Patch)
class Net::HTTP
def patch(path, data, initheader = nil, dest = nil, &block) #:nodoc:

View file

@ -1,5 +1,5 @@
module HTTParty
class Response < HTTParty::BasicObject #:nodoc:
class Response < BasicObject
def self.underscore(string)
string.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').gsub(/([a-z])([A-Z])/,'\1_\2').downcase
end