dbc_today 2.0.5 → 2.0.6
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.
- checksums.yaml +4 -4
- data/lib/dbc_today/models/event.rb +11 -10
- data/lib/dbc_today/models/topic.rb +3 -3
- data/lib/dbc_today/version.rb +1 -1
- data/lib/dbc_today/views/events_view.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a845a25b6bc2af798044d250bb59a4211cb7c467
|
4
|
+
data.tar.gz: b5d8b220a4c1322f94a269784a4b9e811c12805c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 423b337a27e0859bef975a957d35309deb98f8cff29914bdaae84e77aedba72c3a21dc26b6e6d8fb25255b43d6e92d523f22d51d57beb839796277a623a94636
|
7
|
+
data.tar.gz: 2e6254eeafb03f2fecb81a95dbef6254df5a8e6093f6d77f410b59450d37dbb0bd8ca3b5828c58a5e9dea661080575f278336f954905238aac4eea73e822e5d8
|
@@ -9,9 +9,9 @@ class Event
|
|
9
9
|
@phase = attributes.fetch(:phase)
|
10
10
|
@week = attributes.fetch(:week)
|
11
11
|
@day = attributes.fetch(:day)
|
12
|
-
@description = attributes.fetch(:description
|
13
|
-
@start_time = attributes.fetch(:start_time
|
14
|
-
@end_time = attributes.fetch(:end_time
|
12
|
+
@description = attributes.fetch(:description)
|
13
|
+
@start_time = attributes.fetch(:start_time)
|
14
|
+
@end_time = attributes.fetch(:end_time)
|
15
15
|
end
|
16
16
|
|
17
17
|
def all_day?
|
@@ -47,22 +47,23 @@ class Event
|
|
47
47
|
def self.where(args)
|
48
48
|
all.select { |event|
|
49
49
|
nil_or_match(event.phase, args[:phase]) &&
|
50
|
-
|
51
|
-
|
50
|
+
nil_or_match(event.week, args[:week]) &&
|
51
|
+
nil_or_match(event.day, args[:day])
|
52
52
|
}.sort_by { |e| e.start_time_military }
|
53
53
|
end
|
54
54
|
|
55
55
|
private
|
56
56
|
|
57
57
|
def starts_at_day_start?
|
58
|
-
start_time.
|
59
|
-
|
58
|
+
return false if start_time.nil?
|
59
|
+
|
60
|
+
start_time.start_with?('9:00a', '9a')
|
60
61
|
end
|
61
62
|
|
62
63
|
def ends_at_day_end?
|
63
|
-
end_time.nil?
|
64
|
-
|
65
|
-
|
64
|
+
return false if end_time.nil?
|
65
|
+
|
66
|
+
end_time.start_with?('6:00p', '6p')
|
66
67
|
end
|
67
68
|
|
68
69
|
def self.nil_or_match(attribute_value, value_to_match)
|
@@ -26,12 +26,12 @@ class Topic
|
|
26
26
|
def self.where(args)
|
27
27
|
all.select { |topic|
|
28
28
|
topic.phase == args[:phase] &&
|
29
|
-
|
30
|
-
|
29
|
+
topic.week == args[:week] &&
|
30
|
+
topic.day == args[:day]
|
31
31
|
}
|
32
32
|
end
|
33
33
|
|
34
34
|
def self.current_directory
|
35
|
-
File.expand_path File.dirname(__FILE__)
|
35
|
+
File.expand_path File.dirname(__FILE__)
|
36
36
|
end
|
37
37
|
end
|
data/lib/dbc_today/version.rb
CHANGED