Hashの値もflattenする
class Array def flatten_with_hash inject([]){ |r, h| if h.is_a?(Hash) r << h.keys.flatten_with_hash r << h.values.flatten_with_hash else r << h end r }.flatten end end