3
# A method to convert a Hash into a Struct.
5
# h = {:name=>"Dan","age"=>33,"rank"=>"SrA","grade"=>"E4"}
6
# s = h.to_struct("Foo")
8
# TODO: Is this robust enough considerd hashes aren't ordered?
10
# CREDIT: Daniel Berger
12
def to_struct(struct_name)
13
Struct.new(struct_name,*keys).new(*values)