def each_item(group=nil, &block)
      group = group || @groups

      group.each do |item|
        if item["items"]
          each_item(item["items"], &block)
        else
          block.call(item)
        end
      end
    end
def each_item(group=nil, &block)
      group = group || @groups

      group.each do |item|
        if item["items"]
          each_item(item["items"], &block)
        else
          block.call(item)
        end
      end
    end
Iterates over all items in all groups