gthc 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4a4d5c17afbded52b98ab45a4790c0b40603c84bd4dfdda8b372a098d1350fa
4
- data.tar.gz: d08051fe205d84b2619a56a42b3be1ca34e33dc7200d4d61e1e3d0c8c631999b
3
+ metadata.gz: 70381a1386ec4f12793185fdb92de92e4a4c8bceea8d96a7ead6e0a6efbc9e9e
4
+ data.tar.gz: 9e986223088c9a60e48f93601f37d3c46fcfc2e7caeb86a8123398493c3bfea3
5
5
  SHA512:
6
- metadata.gz: 70b7aebf6fda10145d3772ff72bd7aa11be6d2e97f4a59affb1ed1f1da43f161efcbd4fa835c5b4199361a8d4908f69061056fdedf869f7ba4602da58c744c85
7
- data.tar.gz: f160ec0134082c62c56929558a6e2cd59c60d18106a389320bd4b422e43615aaa0c163293e7097f12e77e4d09392a53e74938f561d8296ce47c7d772aff46d3d
6
+ metadata.gz: 4c4a5f33d44ec652b3452bfdf663d804823816674c9ad0e82871318580a9b6439875216f76e3967b41200bb557abe128322328be62be25da903d8aeeff4f0f31
7
+ data.tar.gz: 9242356aedeb3a73fb220d6d34dfca1bc3dca2797b4c384a128d8b6693045ce97dd6e8a620c5b45d97edf37aaf827edd69c2f58832251122c297d0554e552e93
@@ -1,4 +1,6 @@
1
1
  require "gthc/olson/algorithm"
2
+ require "gthc/olson/person"
3
+ require "gthc/olson/slot"
2
4
 
3
5
  module GTHC
4
6
  module Olson
@@ -8,5 +10,13 @@ module GTHC
8
10
  # Algorithm
9
11
  schedule(peopleList, scheduleGrid)
10
12
  end
13
+
14
+ def self.Person
15
+ Person
16
+ end
17
+
18
+ def self.Slot
19
+ Slot
20
+ end
11
21
  end
12
22
  end
@@ -0,0 +1,17 @@
1
+ class Person
2
+ attr_accessor :id,
3
+ :name,
4
+ :dayFree, :nightFree,
5
+ :dayScheduled, :nightScheduled
6
+
7
+ def initialize(id, name, dayFree, nightFree, dayScheduled, nightScheduled)
8
+ @id = id
9
+ @name = name
10
+ @dayFree = dayFree
11
+ @dayScheduled = dayScheduled
12
+ @nightFree = nightFree
13
+ @nightScheduled = nightScheduled
14
+ # @maxDayHours = maxDayHours
15
+ # @idealDayHours = idealDayHours
16
+ end
17
+ end
@@ -0,0 +1,44 @@
1
+ # Slots objects make up the ScheduleGrid input.
2
+
3
+ class Slot
4
+ attr_accessor :personID, :ids,
5
+ :startDate, :endDate,
6
+ :phase,
7
+ :isNight,
8
+ :status,
9
+ :row, :col,
10
+ :weight
11
+
12
+ def initialize(personID, startDate, endDate, phase, isNight, status, row, col, weight=1)
13
+ @personID = personID
14
+ @startDate = startDate
15
+ @endDate = endDate
16
+ @phase = phase
17
+ @isNight = isNight
18
+ @status = status
19
+ @row = row
20
+ @col = col
21
+ @weight = 1
22
+ @ids = nil
23
+ end
24
+
25
+ def to_hash
26
+ hash = {}
27
+ instance_variables.each { |var| hash[var.to_s.delete('@')] = instance_variable_get(var) }
28
+ hash
29
+ end
30
+
31
+ def self.attr_accessor(*vars)
32
+ @attributes ||= []
33
+ @attributes.concat vars
34
+ super(*vars)
35
+ end
36
+
37
+ def self.attributes
38
+ @attributes
39
+ end
40
+
41
+ def attributes
42
+ self.class.attributes
43
+ end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module GTHC
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gthc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aman Ibrahim
@@ -77,6 +77,8 @@ files:
77
77
  - lib/gthc/olson.rb
78
78
  - lib/gthc/olson/algorithm.rb
79
79
  - lib/gthc/olson/helpers.rb
80
+ - lib/gthc/olson/person.rb
81
+ - lib/gthc/olson/slot.rb
80
82
  - lib/gthc/olson/weight.rb
81
83
  - lib/gthc/version.rb
82
84
  homepage: https://www.gthc.io/