Permalink
Browse files

Mostrando diferenças entre strings e simbolos quanto à instanciação d…

…e objetos
  • Loading branch information...
andersondias committed Aug 30, 2010
1 parent 7b24f0b commit 5cfc99085707951ba0e9946537e925a1569e0edc
Showing with 8 additions and 1 deletion.
  1. +8 −1 11_simbolos.rb
View
@@ -43,4 +43,11 @@ def caminhar(direcao)
:facil => Criatura.new('gato', 10, 10),
:normal => Criatura.new('urso', 50, 50),
:normal => Criatura.new('dragao', 150, 150)
-}
+}
+
+# são objetos únicos
+
+puts "test".object_id
+puts "test".object_id
+puts :test.object_id
+puts :test.object_id

0 comments on commit 5cfc990

Please sign in to comment.