summaryrefslogtreecommitdiff
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:14:17 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 15:14:17 +0000
commitf9a169fff2831c0350a157a589c1fa3dfe8840ea (patch)
treee3ddc5a6e428775fea053d6dc308f89ecf1f82de /lib/ostruct.rb
parent5b5de3984e31b75643ad3ffc97c149436498c33d (diff)
* lib/ostruct.rb: raise NoMethodError with a #name and #args.
Patch by Kenichi Kamiya. [Fixes GH-383] * test/ostruct/test_ostruct.rb: Added tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index d3aea63..f51eb7b 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -184,7 +184,9 @@ class OpenStruct
elsif len == 0
@table[mid]
else
- raise NoMethodError, "undefined method `#{mid}' for #{self}", caller(1)
+ err = NoMethodError.new "undefined method `#{mid}' for #{self}", mid, args
+ err.set_backtrace caller(1)
+ raise err
end
end