SyntaxFix
Write A Post
Hire A Developer
Questions
You can write a very elegant solution using a functional style.
class Object def hashify Hash[instance_variables.map { |v| [v.to_s[1..-1].to_sym, instance_variable_get v] }] end end