Skip to content

Instantly share code, notes, and snippets.

@geocodinglife
Last active March 20, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geocodinglife/584bd8ced44d92e03e2f2483b822d2e0 to your computer and use it in GitHub Desktop.
Save geocodinglife/584bd8ced44d92e03e2f2483b822d2e0 to your computer and use it in GitHub Desktop.
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