Last active
April 17, 2016 21:28
-
-
Save jarrettgreen/1de35dfa1061602f6af31cc8043e4120 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Garlic | |
def initialize(type:) | |
@type = type | |
end | |
end | |
class Person | |
def initalize(first_name:) | |
@firstname = first_name | |
end | |
def garlic_snob?(garlic:) | |
case garlic.type | |
when 'fresh' | |
false | |
when 'minced in a jar and gross' | |
true | |
end | |
end | |
end | |
jarrett = Person.new(first_name: 'Jarrett') | |
minced_jar_garlic = Garlic.new(type: 'minced in a jar and gross') | |
jarrett.garlic_snob?(garlic: minced_jar_garlic) # returns true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment