Skip to content

Instantly share code, notes, and snippets.

@elomar
Created November 13, 2011 00:42
Show Gist options
  • Save elomar/1361372 to your computer and use it in GitHub Desktop.
Save elomar/1361372 to your computer and use it in GitHub Desktop.
# encoding: utf-8
class Contato
attr_accessor :nome, :telefone
end
opcao = nil
contatos = []
while opcao != "s"
puts "Digite sua opção:"
puts "a - adicionar"
puts "s - sair"
opcao = gets.chomp
if opcao == "a"
contato = Contato.new
puts "Nome:"
contato.nome = gets.chomp
puts "Telefone:"
contato.telefone = gets.chomp
contatos << contato
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment