Skip to content

Instantly share code, notes, and snippets.

@rafaelss
Created June 22, 2010 00:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelss/447725 to your computer and use it in GitHub Desktop.
Save rafaelss/447725 to your computer and use it in GitHub Desktop.
# idéia original em php: http://goncin.wordpress.com/2010/06/21/ditados-populares-em-php/
###############
if tempo.is?(:chuvoso)
cavalinho.recolher
end
################
begin
vencer(@eles)
rescue
juntarSeA(@eles)
end
################
if !@meus_animais.include?(:cachorro)
cacarCom(:gato)
end
################
@espeto = Espeto.new(:pau) if @casa.owner?(:ferreiro)
################
@macacos.each do |macaco|
galho = Galho.new
galho.receber(macaco)
end
################
@seguro.die if @seguro.idade >= 80 # die não existe no ruby nativamente, então esse exemplo ficou nada a ver :)
################
if @filho.parent == :peixe
@filho.type(:peixinho)
end
################
if @rio.peixes.include?(:piranha)
@jacare.estilo_nadar(NADO_COSTAS)
end
################
if @olhos.owner != self
@refresco = @pimenta
@refresco.colocar_em(@olhos)
end
################
@homem.valor *= 2 if @homem.prevenido?
################
Deus.ajudar(@pessoa) if @pessoa.hora_acordou < Time.parse('7:00') # Deus é SINGLETON!
################
# Ruby não tem goto :D
## Quem tem boca vai a Roma
## if $pessoa->temBoca())
## goto Roma;
## // Milhares de linhas de código depois...
## :Roma
## echo ('Parabéns, você chegou a Roma');
################
@galinha.papo.num_graos += 1 until @galinha.papo.cheio?
################
raise 'Tire a mão daí!!!' if @macaco.idade >= 60 and @macaco.mao.onde_esta == :cumbuca
################
@agua.consistencia = :mole
@pedra.consistencia = :dura
@agua.bater(@pedra) while not @pedra.esta_furada?
@rafapolo
Copy link

hahah, muito bom. tu quem bolou?

@rafaelss
Copy link
Author

@ShadowBelmolve
Copy link

acho q assim fica melhor :)

@galinha.papo.num_graos += 1 until @galinha.papo.cheio?

@rafaelss
Copy link
Author

bem melhor mesmo! arrumado :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment