Created
November 12, 2015 10:42
-
-
Save fitomad/8e171a0345160ec2d1a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Ejemplo para probar la instalación de Ruby | |
# | |
class User | |
# Constructor | |
def initialize(name) | |
@name = name | |
end | |
# Descripcion de la clase | |
def to_s | |
return "It's #{@name}" | |
end | |
end | |
# Creamos un usuario... | |
user = User.new("me") | |
# ...y nos saluda | |
print("Hi! #{user.to_s}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment