-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from alexendrios/master
file modification Ruby.rb
- Loading branch information
Showing
1 changed file
with
48 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,48 @@ | ||
puts 'Hello World' | ||
#classe Interação | ||
class Interacao | ||
|
||
#metodo pular linha | ||
def pular_linha(qtd) | ||
i = 0 | ||
while i < qtd | ||
puts '' | ||
i += 1 | ||
end | ||
end | ||
|
||
#metodo limpar | ||
def limpar | ||
system('cls') | ||
end | ||
|
||
#metodo Cabeçalho | ||
def cabecalho | ||
puts 'Hacktoberfest2018' | ||
puts '------------------' | ||
end | ||
|
||
#metodo Cabeçalho | ||
def boas_vindas(name, age, profession) | ||
limpar | ||
cabecalho | ||
pular_linha 1 | ||
puts "Welcome #{name} !!!" | ||
puts "You are #{age} years" | ||
puts "Your profession is #{profession}" | ||
pular_linha 2 | ||
print "Enjoy Hacktoberfest2018 and enjoy yourself!!! " | ||
end | ||
end | ||
|
||
@config = Interacao.new | ||
|
||
@config.cabecalho | ||
@config.pular_linha 1 | ||
print "You name: " | ||
name = gets.chomp.upcase | ||
print "You age: " | ||
age = gets.to_i | ||
print "What is your profession: " | ||
profession = gets.chomp.upcase | ||
@config.boas_vindas name, age, profession | ||
@config.pular_linha 2 |