Skip to content

Instantly share code, notes, and snippets.

@hiro-riveros
Created August 27, 2018 16:09
Show Gist options
  • Save hiro-riveros/830ed5fe46102eb3164c0b6308273876 to your computer and use it in GitHub Desktop.
Save hiro-riveros/830ed5fe46102eb3164c0b6308273876 to your computer and use it in GitHub Desktop.
Ruby method to indemnify chilean employees
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