Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Created August 5, 2013 20:53
Show Gist options
  • Save marciojrtorres/6159521 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6159521 to your computer and use it in GitHub Desktop.
Lidando com a Tipagem Segura em Ruby
a = 1
b = "a"
c = a + b.to_i # o método to_i converte b para inteiro ("a" vale 0)
print c # imprime 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment