Sha256: 6e6f9e78243290d92b87ce3d9c579298de19234573f103011b7a8e65e462c28d

Contents?: true

Size: 602 Bytes

Versions: 3

Compression:

Stored size: 602 Bytes

Contents

begin
  require 'win32ole.so'
rescue LoadError
  # do nothing
end

if defined?(WIN32OLE)
  # WIN32OLE
  class WIN32OLE

    #
    # By overriding Object#methods, WIN32OLE might
    # work well with did_you_mean gem.
    # This is experimental.
    #
    #  require 'win32ole'
    #  dict = WIN32OLE.new('Scripting.Dictionary')
    #  dict.Ade('a', 1)
    #  #=> Did you mean?  Add
    #
    def methods(*args)
      super + ole_methods_safely.map(&:name).map(&:to_sym)
    end

    private

    def ole_methods_safely
      ole_methods
    rescue WIN32OLEQueryInterfaceError
      []
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
win32ole-1.8.10 lib/win32ole.rb
win32ole-1.8.9 lib/win32ole.rb
win32ole-1.8.8 lib/win32ole.rb