Created
April 13, 2010 03:01
-
-
Save leobessa/364267 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
class Time | |
def day_light? | |
(6..18).include? self.hour | |
end | |
end | |
class Maria | |
def greet | |
p "Bom dia" | |
end | |
end | |
class Joao | |
def greet | |
p "E aê mano?" | |
end | |
end | |
class MariaSapatao < Time.now.day_light? ? Maria : Joao | |
end | |
MariaSapatao.new.greet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment