Skip to content

Commit

Permalink
Fix net income service.
Browse files Browse the repository at this point in the history
  • Loading branch information
neb417 committed Jul 15, 2024
1 parent ce0b0d3 commit d8a8d19
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions app/services/net_income_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ class NetIncomeCalculator

def initialize(annual_income:)
@annual_income = annual_income
@biannual_income = biannual_income
@quarterly_income = quarterly_income
@monthly_income = monthly_income
@weekly_income = weekly_income
@daily_income = daily_income
@biannual_income = calculate_biannual_income
@quarterly_income = calculate_quarterly_income
@monthly_income = calculate_monthly_income
@weekly_income = calculate_weekly_income
@daily_income = calculate_daily_income
end

def biannual_income
annual_income / 2
def calculate_biannual_income
@annual_income / 2
end

def quarterly_income
annual_income / 4
def calculate_quarterly_income
@annual_income / 4
end

def monthly_income
annual_income / 12
def calculate_monthly_income
@annual_income / 12
end

def weekly_income
annual_income / 52
def calculate_weekly_income
@annual_income / 52
end

def daily_income
annual_income / 365
def calculate_daily_income
@annual_income / 365
end
end

0 comments on commit d8a8d19

Please sign in to comment.