我有一系列链接:
urls = [ ["http://s3.amazonxaws.com/bb_images/uk/media_images/2/1-veXRiLqrxPbguaxFIcFbPA.png"], ["http://s3.amazonaws.com/bb_images/uk/media_images/2/1-veXRiLqrxPbguaxFIcFbPA.png"] ]
我怎样才能返回true
如果所有的环节下手"http://s3.amazonaws.com"
?
我试过了:
if urls.any? { |url| url.include?('http://s3.amazonaws.com/') } #execute code else #execute else code end
但它没有返回true
或false
在案件中.
urls.flatten.all?{|s| s.start_with?("http://s3.amazonaws.com")}