Created
August 27, 2018 16:09
-
-
Save hiro-riveros/830ed5fe46102eb3164c0b6308273876 to your computer and use it in GitHub Desktop.
Ruby method to indemnify chilean employees
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def indemnify_employee(salary, worked_months) | |
return 'without indemnify' if worked_months < 12 | |
calc_indemnify = -> (salary, worked_months) do | |
return salary * (worked_months.to_f / 12).ceil | |
end | |
calc_indemnify.call(salary, worked_months) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment