Sha256: 6ff0e561be85f8475cba4f1abc6966177d915cf57d713016ff165dcae1e3fd74

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

module P2
  # Represents P2ClientGate OLE type library.
  # Only works with STA version ( Ruby WIN32OLE limitation ).
  class Library < WIN32OLE_TYPELIB
    include P2

    # Returns default lib if not explicitely instantiated
    #
    def self.default
      @library ||= new
    end

    def initialize
      p2lib = WIN32OLE_TYPELIB.typelibs.find { |t| t.name =~ /P2ClientGate / }
      error "No registered STA P2ClientGate, please register P2ClientGate.dll" unless p2lib
      super p2lib.name
    end

    def find name
      self.ole_types.map(&:progid).compact.find { |progid| progid[name] }
    end

  end # class Library
end # module P2

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
p2ruby-0.1.5 lib/p2ruby/library.rb
p2ruby-0.1.4 lib/p2ruby/library.rb
p2ruby-0.1.2 lib/p2ruby/library.rb
p2ruby-0.1.1 lib/p2ruby/library.rb
p2ruby-0.1.0 lib/p2ruby/library.rb