220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
|
# File 'lib/appkernel/function.rb', line 220
def comb(args)
positionals = []
parameters = {}
rest_parameters = {}
rest = []
index = @indexed.compact.length
for arg in args
if Hash === arg
for name,value in arg
key = name.to_sym
if opt = @options[key]
parameters[opt.name] = value
else
rest_parameters[key] = value
end
end
elsif index > 0
index -= 1
positionals << arg
else
rest << arg
end
end
rest << rest_parameters unless rest_parameters.empty?
return positionals, parameters, rest
end
|