#to_hash for Ruby 1.9 compatibility