Skip to content

Instantly share code, notes, and snippets.

@CyrusNuevoDia
Created September 23, 2015 22:08
Show Gist options
  • Save CyrusNuevoDia/038fd50906f5f086b20c to your computer and use it in GitHub Desktop.
Save CyrusNuevoDia/038fd50906f5f086b20c to your computer and use it in GitHub Desktop.
class Salary
attr_reader :total_compensation
def initialize(base:, bonus_percentage: 0, seniority_factor: 0, deduction:)
@total_compensation = base.tap do |n|
n += n * bonus_percentage
n += n * seniority_factor
n -= deduction
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment