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

Switched from BlankSlate to BasicObject and only defining it if it doesn't exist for ruby 1.9 compat.

Closes gh-20
This commit is contained in:
John Nunemaker 2009-08-22 10:30:53 -04:00 committed by Sandro Turriate
parent f2fa3ce13b
commit 4eb14a17ba
2 changed files with 4 additions and 8 deletions

View file

@ -1,10 +1,6 @@
if RUBY_VERSION.to_f == 1.8
class BlankSlate #:nodoc:
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval|object_id/ }
end
else
class BlankSlate < BasicObject; end
end
class BasicObject #:nodoc:
instance_methods.each { |m| undef_method m unless m =~ /^__|instance_eval/ }
end unless defined?(BasicObject)
# 1.8.6 has mistyping of transitive in if statement
require "rexml/document"

View file

@ -1,5 +1,5 @@
module HTTParty
class Response < BlankSlate #:nodoc:
class Response < BasicObject #:nodoc:
attr_accessor :body, :code, :message, :headers
attr_reader :delegate