method
generate_args
v1_9_1_378 -
Show latest stable
-
0 notes -
Class: WIN32COMGen
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
generate_args(method)
public
Hide source
# File ext/win32ole/sample/olegen.rb, line 24 def generate_args(method) args = [] if method.size_opt_params >= 0 size_required_params = method.size_params - method.size_opt_params else size_required_params = method.size_params - 1 end size_required_params.times do |i| if method.params[i] && method.params[i].optional? args.push "arg#{i}=nil" else args.push "arg#{i}" end end if method.size_opt_params >= 0 method.size_opt_params.times do |i| args.push "arg#{i + size_required_params}=nil" end else args.push "*arg" end args.join(", ") end