AutoAssignment 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/autoassignment.rb +65 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e1664fb936b0845e97afe43021b2e028663de6d6
4
+ data.tar.gz: e2e9f5952ebefa9fbeff9b92f14147358a4749b0
5
+ SHA512:
6
+ metadata.gz: 4c4ea710f462a425217fa2d0bed3bd0679e40101741a78590495777e070cd05ab8b2d934bd4141943b861e67daa2e48303eddfb9ca59d82943a710be635d76ac
7
+ data.tar.gz: e8fbe8780169c508338c75cb91acf2e3f1ed86aee82574e1ace567e1dc20dfa9dd63ffaf086d29f53d0efb8d624c03206e36229972da8d40319e33ef8c4add9d
@@ -0,0 +1,65 @@
1
+ module AutoAssignment
2
+
3
+ def self.assign(employeeArray)
4
+ @empArray = []
5
+ @empAssign = []
6
+ @empResolve = []
7
+ @temp = Employee
8
+ @temp1 = Employee
9
+ @count = 0
10
+ @count1 = 0
11
+ @assignVal = 0
12
+ @assign = 0
13
+
14
+ @empArray = employeeArray
15
+
16
+ # start for assigned
17
+ @temp = employeeArray[0].assignedtasks
18
+ @empArray.each do |emp|
19
+ if emp.assignedtasks < @temp
20
+ @temp = emp.assignedtasks
21
+ end
22
+ end
23
+
24
+ @empArray.each do |emp|
25
+ if emp.assignedtasks == @temp
26
+ @empAssign[@count] = emp
27
+ puts "result1--------#{@empAssign[@count].name}"
28
+ @count = @count+1
29
+ end
30
+ end
31
+ #end for assigned
32
+ puts "ggjjjjjj#{@count}"
33
+ #start for resolved
34
+ if @count > 1
35
+ @temp1 = @empAssign[0].resolvedtasks
36
+ @empAssign.each do |emp|
37
+ #@temp = emp.resolvedtasks
38
+ puts "out1>>>#{@temp1}"
39
+ if emp.resolvedtasks > @temp1
40
+ @temp1 = emp.resolvedtasks
41
+ puts "in1>>>#{@temp1}"
42
+ end
43
+ end
44
+ @empAssign.each do |emp|
45
+ puts "out2>>>#{@temp1}"
46
+ if emp.resolvedtasks == @temp1
47
+ @empResolve[@count1] = emp
48
+ puts "result2--------#{@empResolve[@count1].name}"
49
+ @count1 = @count1+1
50
+ end
51
+ end
52
+ end
53
+ #end for resolved
54
+
55
+ puts "hhhhhhhh #{@count1}"
56
+ if @count1 >= 1
57
+ puts "result3--------#{@empResolve[0].name}"
58
+ return @empResolve[0]
59
+ elsif @count1 == 1
60
+ return @empResolve[0]
61
+ elsif @count == 1
62
+ return @empAssign[0]
63
+ end
64
+ end
65
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: AutoAssignment
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Prashant Agavane
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Automatic task assignment based on task priority,employee skill_level
14
+ and employee workload
15
+ email: p.agawane7@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/autoassignment.rb
21
+ homepage: http://rubygems.org/gems/autoassignment
22
+ licenses: []
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.6.8
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Task auto assignment
44
+ test_files: []