From 911f92c0f85309c287812b8659db1f0b46988566 Mon Sep 17 00:00:00 2001 From: mgamba Date: Fri, 4 May 2012 04:10:57 -0300 Subject: [PATCH] http://tinyurl.com/7pcax79 --- lovespell.rb | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/lovespell.rb b/lovespell.rb index 7c56af1..10892df 100644 --- a/lovespell.rb +++ b/lovespell.rb @@ -1,32 +1,29 @@ -class Lovespell - def initialize(*potions) - @potions = potions - end - - def crush - puts "To initiate a crush, procure #{@potions.map(&:capitalize).join(", ")} and slip these items into their breakfast." - end - - def infatuation -puts "To initiate an infatuation, slip #{@potions.map(&:upcase).join(", ")} in their coffee." - end - - def killspell -puts "To break the spell, dribble #{@potions.map(&:reverse).join(", ")} on their pillow." - end +class Underherspell + def initialize(*potions) + @potions = potions + end + + def crush + puts !![@potions].inject(){|rosepetal| rosepetal = !rosepetal} ? "she loves me" : "she loves me not" + end + + def infatuation + @potions.each{|anything| puts "I would give all the #{anything} in the world to be with her"} + end + + def killspell + puts "#{"she remains faintly present, ever in my heart".reverse} #{@potions.map(&:reverse).join(", ")} #{"And yet, like the lingering scent of".reverse}" + end end -cutemathematician= Lovespell.new("honey", "saffron", "chocolate") +cutemathematician= Underherspell.new("honey", "saffron", "chocolate") cutemathematician.crush cutemathematician.infatuation cutemathematician.killspell -puts "\n" * 3 - -girlwithtattoo = Lovespell.new( "agave nectar", "yogurt", "roasted almonds", "vanilla", "hazelnuts") -girlwithtattoo.crush -girlwithtattoo.infatuation -girlwithtattoo.killspell - +puts "#{"\n<3"*3}\n\n" -puts "\n" * 3 +programmerwithmotorcycle = Underherspell.new( "agave nectar", "yogurt", "roasted almonds", "vanilla", "hazelnuts") +programmerwithmotorcycle.crush +programmerwithmotorcycle.infatuation +programmerwithmotorcycle.killspell