Ruby - Enumerable - group_by

  • + 0 comments
    def group_by_marks(marks, pass_marks)
          marks.group_by {|key, x| (x >= pass_marks) == true  ? "Passed" : "Failed" }
    end