Ruby Control Structures - Case (Bonus Question)

  • + 4 comments

    Got the same solution and its failing on every test case. Can't figure out what's happening:

    def identify_class(obj)
      case obj
      when "Hacker", "Submission", "TestCase", "Contest"
        puts "It\'s a #{obj}!"
      else
        puts "It\'s an unknown model"
      end
    end
    

    gettting correct reuturns when running it locally:

    identify_class('Hacker')
    identify_class('Submission')
    identify_class('TestCase')
    identify_class('Submission')
    identify_class('Contest')