daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Mar 20th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Employee
  2.   attr_accessor :name, :salary
  3.   def initialize(name, salary)
  4.     @name   = name
  5.     @salary = salary.to_i
  6.   end
  7.  
  8.  
  9.  
  10.   def start_salary
  11.     EmployeeSalary.new(salary)
  12.   end
  13. end
  14.  
  15. class EmployeeSalary
  16.   attr_accessor :salary
  17.   def initialize(salary)
  18.     @salary = salary.to_i
  19.   end
  20.  
  21.   def base_salary
  22.     salary - (salary *  0.12)
  23.   end
  24. end
  25.  
  26. class Manager < Employee
  27.  
  28. end
  29.  
  30. employee1 = Employee.new("Jose", 99)
  31. p employee1.start_salary
RAW Paste Data
Top