1
2
3
4
5
6
7
8
9
10
11
12
class ConditionArray < Array
  def &(a)
    if a.class.name == 'Array'
      b = self.clone
      b[0] = (b.length > 0) ? "#{b[0]} and #{a[0]}" : a[0]
      b << a[1..-1] if a.length > 1
      b.flatten
    else
      super(a)
    end
  end
end