Skip to content

Instantly share code, notes, and snippets.

@ameseee
Last active February 11, 2019 03:25
Show Gist options
  • Save ameseee/a000c62f3656a3e2f197bb9e565213c8 to your computer and use it in GitHub Desktop.
Save ameseee/a000c62f3656a3e2f197bb9e565213c8 to your computer and use it in GitHub Desktop.
class Hedgehog

  def initialize(name, age, allergies)
    @name = name
    @age = age
    @allergies = allergies
  end

  def invite_to_party
     "#{@name} is invited to the party!"
  end

  def self.confirm_attendee
    "Another hedgie is coming to the party!"
  end

  def check_for_allergies
    "Make sure to not serve any #{@allergies}."
  end

end

Complete the following chart, assuming we have run...

hedgie_1 = Hedgehog.new("Sonic", 4, "ketchup")

Code to Run ~~~~~ Your Prediction of Output ~~~~~ OR - Check here if no clue
p hedgie_1
p hedgie_1.invite_to_party
p hedgie_1.confirm_attendee
p hedgie_1.check_for_allergies
p Hedgehog.invite_to_party
p Hedgehog.confirm_attendee
p Hedgehog.check_for_allergies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment