此方法接受 URL 列表:
Magick::ImageList.new("img1url", "img2url", "img3url")
我有这个字符串"url1, url2, url3"
。
如何将上述方法作为单独的参数提供给我的列表?我试过了:
urls = urls.split(',')
Magick::ImageList.new(urls) # fails. It produces an array.
# fails. It produces "'img1url','img2url'".
# The comma is part of the string, but it should split method arguments.
urls = urls.split(',').join("','")
Magick::ImageList.new(urls)