对ary.product(other_ary, …)方法的一点扩充

2015-08-12 0 590
对ary.product(other_ary, …)方法的一点扩充
def flatten(array, arr)
    begin
      unless array[0].flatten.size == array[0].size
        flatten(array[0], arr)
      else
        arr << array[0]
      end
      arr << array[1]
    rescue
      raise "第一个参数不能为一维数组!"
    end
  end

遇见资源网 ruby 对ary.product(other_ary, …)方法的一点扩充 http://www.ox520.com/16423.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务