Class: Gap::DLLFunction
- Inherits:
-
Object
- Object
- Gap::DLLFunction
- Defined in:
- lib/gap50/gap/dll.rb
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(path, name) ⇒ DLLFunction
constructor
A new instance of DLLFunction.
Constructor Details
#initialize(path, name) ⇒ DLLFunction
Returns a new instance of DLLFunction.
3 4 5 6 |
# File 'lib/gap50/gap/dll.rb', line 3 def initialize(path, name) @path = path @name = name end |
Instance Method Details
#call(*args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/gap50/gap/dll.rb', line 8 def call(*args) param = args.map do |x| case x when Integer "L" else "p" end end begin Win32API.new(@path, @name, param, "L").call(*args) rescue LoadError Win32API.new(File.(@path), @name, param, "L").call(*args) end end |