fixes #56 by accounting for case that would produce zero rows

This commit is contained in:
Melody
2015-07-08 22:28:36 -04:00
parent e43f68d323
commit 4bc8ba7455
+4
View File
@@ -221,8 +221,12 @@ module Squib
def rowify(opts)
unless opts[:rows].respond_to? :to_i
raise "Columns must be an integer" unless opts[:columns].respond_to? :to_i
if @cards.size < opts[:columns].to_i
opts[:rows] = 1
else
opts[:rows] = (@cards.size / opts[:columns].to_i).ceil
end
end
opts
end