Skip to content

Instantly share code, notes, and snippets.

@jarrettgreen
Last active April 17, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarrettgreen/1de35dfa1061602f6af31cc8043e4120 to your computer and use it in GitHub Desktop.
Save jarrettgreen/1de35dfa1061602f6af31cc8043e4120 to your computer and use it in GitHub Desktop.
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