Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # In this file we define the methods to help filter out candidates
- # This way, we keep these methods separated from other potential parts of the program
- def find(id)
- check = @candidates.find {|cand| cand[:id] == id}
- return check
- end
- def experienced?(candidate)
- if candidate[:years_of_experience] >= 2
- puts true
- else
- puts false
- end
- end
- def qualified_candidates(candidates)
- check = candidates.find_all {|cand| cand[:years_of_experience] >= 2 && cand[:github_points] >= 100 && cand[:age] > 17 && cand[:date_applied] >= 15.days.ago.to_date && (cand[:languages].include?("Python") || cand[:languages].include?("Ruby"))}
- puts check
- end
- def ordered_by_qualifications(candidates)
- ordered = candidates.sort_by { |i| [i[:years_of_experience], i[:github_points]] }
- return ordered.reverse
- end
- # More methods will go below
Add Comment
Please, Sign In to add comment