Simply use OpenStruct#to_h
to receive an OpenStruct's hash representation.
In older Rubies you need OpenStruct#marshal_dump
instead.
>> OpenStruct.new(foo: 23, bar: 42).to_h
=> { :foo => 23, :bar => 42 }
>> OpenStruct.new(:foo => 23, :bar => 42).marshal_dump
=> { :foo => 23, :bar => 42 }
Both approaches will return the underlying hash table (a clone of it in Ruby 2.0+).