Class: ExternalAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/external_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(dll_path) ⇒ ExternalAPI

Returns a new instance of ExternalAPI.



4
5
6
7
# File 'lib/external_api.rb', line 4

def initialize(dll_path)
	@dll_path = dll_path
	@proc = Hash.new
end

Instance Method Details

#load(name, param, ret) ⇒ Object



9
10
11
12
13
14
# File 'lib/external_api.rb', line 9

def load(name, param, ret)
	@proc[name] = Win32API.new(@dll_path, name, param, ret)
	self.class.send(:define_method, name) do |*args|			
		@proc[name].call *args
	end
end