Created
September 23, 2015 22:08
-
-
Save CyrusNuevoDia/038fd50906f5f086b20c to your computer and use it in GitHub Desktop.
This file contains 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
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