Skip to content

Instantly share code, notes, and snippets.

@mlincoln
Created January 26, 2013 00:57
Show Gist options
  • Select an option

  • Save mlincoln/4639325 to your computer and use it in GitHub Desktop.

Select an option

Save mlincoln/4639325 to your computer and use it in GitHub Desktop.
class Dessert
def initialize(name, calories)
@name = name
@calories = calories
end
# def name = (name)
# @name = name
# end
#a def calories = (calories)
# @calories = calories
# end
def healthy?
if @calories < 200
return true
else
return false
end
end
def delicious?
return true
end
end
class JellyBean < Dessert
def initialize(name, calories, flavor)
@name = name
@calories = calories
@flavor = flavor
end
# def flavor = (flavor)
# @flavor = flavor
# end
def flavor
return @flavor
end
def delicious?
if @flavor == "black licorice"
return false
else
return true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment