diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-05 01:02:04 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-05 01:02:04 +0000 |
commit | 6bac2765a7f8098d40bd369568d6cf308976c8d4 (patch) | |
tree | 4e36f1619c4a9f2590186ce23c252504a452e3ac /ext | |
parent | 62cec32902b3d1cabdc68c12384ef1453862f53e (diff) | |
download | ruby-6bac2765a7f8098d40bd369568d6cf308976c8d4.tar.gz |
ext/win32ole/lib/win32ole.rb (metods): rescue WIN32OLEQueryInterfaceError.
test/win32ole/test_win32ole.rb: add test for WIN32OLE#methods
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/win32ole/lib/win32ole.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/win32ole/lib/win32ole.rb b/ext/win32ole/lib/win32ole.rb index be9d0d4e9b..635510b277 100644 --- a/ext/win32ole/lib/win32ole.rb +++ b/ext/win32ole/lib/win32ole.rb @@ -19,7 +19,15 @@ if defined?(WIN32OLE) # #=> Did you mean? Add # def methods(*args) - super + ole_methods.map(&:name) + super + ole_methods_safely.map(&:name) + end + + private + + def ole_methods_safely + ole_methods + rescue WIN32OLEQueryInterfaceError + [] end end end |