-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmployeeCount.rb
52 lines (45 loc) · 1.15 KB
/
EmployeeCount.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module EmployeeCount
#Initializing all the counters
@@developerCount = 0
@@hrCount = 0
@@accountantCount = 0
@@managerCount = 0
def self.included(base)
base.extend(TotalCount)
end
module TotalCount
#define class methods here
end
#Displays the total number of Accountants
def print_total_accountants
if Hr === self or Accountant === self or Manager === self
print "Total number of Accountants = #{@@accountantCount} \n"
else
puts "No access to #{self}!"
end
end
#Displays the total number of Developers
def print_total_developers
if Hr === self or Developer === self or Manager === self
puts "Total number of Developers = #{@@developerCount} \n"
else
puts "No access to #{self}!"
end
end
#Displays the total number of HRs
def print_total_hrs
if Hr === self or Manager === self
print "Total number of HR Managers = #{@@hrCount} \n"
else
puts "No access to #{self}!"
end
end
#Displays the total number of Managers
def print_total_managers
if Hr === self or Manager === self
print print "Total number of Managers = #{@@managerCount} \n"
else
puts "No access to #{self}!"
end
end
end