Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#
# 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
You can’t perform that action at this time.