Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. a = {:nome=>"joao", :idade=>"25"}
  2. a.to_s!
  3. "{:nome=>\"joao\", :idade=>\"25\"}"
  4. eval(a)
  5.  
  6. quero transformar uma string 'hash' em hash novamente.
  7. encontrei o método eval, porém o rubocop avisa sobre falta de segurança.
  8. tem alguma ideia?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement