Class: ExternalAPI
- Inherits:
-
Object
- Object
- ExternalAPI
- Defined in:
- lib/external_api.rb
Instance Method Summary collapse
-
#initialize(dll_path) ⇒ ExternalAPI
constructor
A new instance of ExternalAPI.
- #load(name, param, ret) ⇒ Object
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 |