def grid_range(range)
      return nil if range.nil?
      Array(range).flatten.map do |pos|
        pos.respond_to?(:to_a) ? pos.to_a : pos
      end.flatten.uniq
    end
def grid_range(range)
      return nil if range.nil?
      Array(range).flatten.map do |pos|
        pos.respond_to?(:to_a) ? pos.to_a : pos
      end.flatten.uniq
    end
Returns an array of grid positions for a range.

 Parameters:

 [+range+] the range definitions, can be
           * a Fixnum
           * a Range
           * an Array of Fixnum, Range or Array objects