Created
May 14, 2015 15:15
-
-
Save ecuageo/7f7b12b2b03acb49d5ab to your computer and use it in GitHub Desktop.
use builtin conversion protocols 3
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 Meals | |
def initialize | |
@breakfeast = "Cereal" | |
@lunch = "Sandwich" | |
@dinner = "Steamed Veggies" | |
end | |
def yield_meals | |
yield @breakfeast | |
yield @lunch | |
yield @dinner | |
end | |
end | |
meals = Meals.new | |
meals_array = [] | |
meals.yield_meals {|ym| meals_array << ym} | |
puts meals_array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment