Last active
March 20, 2017 22:39
-
-
Save geocodinglife/584bd8ced44d92e03e2f2483b822d2e0 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 Employee | |
attr_accessor :name, :salary | |
def initialize(name, salary) | |
@name = name | |
@salary = salary.to_i | |
end | |
def start_salary | |
EmployeeSalary.new(salary) | |
end | |
end | |
class EmployeeSalary | |
attr_accessor :salary | |
def initialize(salary) | |
@salary = salary.to_i | |
end | |
def base_salary | |
salary - (salary * 0.12) | |
end | |
end | |
class Manager < Employee | |
end | |
employee1 = Employee.new("Jose", 99) | |
p employee1.start_salary |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment