loadshedding 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schedule_formatter.rb +7 -2
- 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: b57d19b27e321a5a1465f646764cdd6ebe5d8c07
|
4
|
+
data.tar.gz: daf17ea230bf6026c2f85e54c8ec2ac19ff77596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85cb460320028914b13f8fba9408db6814fe4c7e5e1a83fc32431d8bc5a843313322a17a1e57281e8148f3108ce0c1a8e55d7bbe70bfd832e812ca60885ba97d
|
7
|
+
data.tar.gz: 7f208481a65c71fbd6541ae2a1abc231eed41347fe837d5540201c6f11d8df7df5754044d8fbe8bd0de20edc179b46df9ea24ae782177c915ae27512932edff8
|
data/lib/schedule_formatter.rb
CHANGED
@@ -15,13 +15,18 @@ class ScheduleFormatter
|
|
15
15
|
|
16
16
|
Load Shedding Schedule for #{@date} : #{@date.strftime('%A')}
|
17
17
|
Group Number : #{@group}
|
18
|
-
Morning : #{@unformatted_hash.first}
|
19
|
-
Evening : #{@unformatted_hash.last}
|
18
|
+
Morning : #{format_time @unformatted_hash.first}
|
19
|
+
Evening : #{format_time @unformatted_hash.last}
|
20
20
|
Currently: #{@current_status.status} : #{@current_status.alt_status} in #{@current_status.time_to_change}
|
21
21
|
EOS
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
|
+
|
26
|
+
def format_time(time)
|
27
|
+
"From : #{time.values.first} => To : #{time.values.last}"
|
28
|
+
end
|
29
|
+
|
25
30
|
def set_color
|
26
31
|
@current_status.status == "Off" ? :red : :green
|
27
32
|
end
|