Feb 10, 2012
Friday morning bootcamp blues (in Ruby)
class Student
def initialize(num)
@energy_level = num
end
def will_do_yoga?
tired? ? "Please do Yoga at home today" : "Go to Yoga"
end
def tired?
@energy_level < 2
end
end
class Mehul
def initialize(num)
@energy_level = num
end
def does_Yoga?
if @tired == true
return = "Please do Yoga at home today"
exit
else
go_to_Yoga
end
end
def tired?
@tired = true if @energy_level < 2
@tired = false
end
end
If you like this post, please share it on Twitter.
You can also email me email me
or subscribe to my RSS feed.