Validation of the document such as,
a = {'a' => ['string',123]}
where the element in a['a']
should be a String
. To validate them, I think you can use,
def validate(doc, type)
valid = true
doc.each{|x|
valid &&= x.is_a? type
}
valid
end
1.9.3p392 :010 > validate(a['a'],String) => false