Skip to content

Commit

Permalink
Use a more straightforward way to delegate to Object#method.
Browse files Browse the repository at this point in the history
  • Loading branch information
myronmarston committed Feb 11, 2011
1 parent 78a8028 commit 55fab3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vcr/structs/request.rb
Expand Up @@ -3,7 +3,6 @@ class Request < Struct.new(:method, :uri, :body, :headers)
include Normalizers::Header
include Normalizers::URI
include Normalizers::Body
include Module.new { alias __method__ method }

def self.from_net_http_request(net_http, request)
new(
Expand All @@ -14,9 +13,10 @@ def self.from_net_http_request(net_http, request)
)
end

@@object_method = Object.instance_method(:method)
def method(*args)
return super if args.empty?
__method__(*args)
@@object_method.bind(self).call(*args)
end

def matcher(match_attributes)
Expand Down

0 comments on commit 55fab3b

Please sign in to comment.