loadshedding 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/schedule_formatter.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a149c462f2626cc0b59a034c69995d1da61b78f
4
- data.tar.gz: 6a1023820ae4c6ffc5c279a7178b90d17dc634d2
3
+ metadata.gz: b57d19b27e321a5a1465f646764cdd6ebe5d8c07
4
+ data.tar.gz: daf17ea230bf6026c2f85e54c8ec2ac19ff77596
5
5
  SHA512:
6
- metadata.gz: eab047257b133dd5f11af89632f0aaba4260050ed0f83e362c68aebef52d3c9155bffb0968833171855b07aba167f5923247fa6504fa39dc7117ad8091868f6f
7
- data.tar.gz: 68bd2f3a3cfdf1124aeb96ee670e8abcb8ed63a221b72ba55506d2a5baedd4eaf6a1e7ba29c41c2f2f4ca7b6e17c25492e264930e18d1a5504ffa89011868dbd
6
+ metadata.gz: 85cb460320028914b13f8fba9408db6814fe4c7e5e1a83fc32431d8bc5a843313322a17a1e57281e8148f3108ce0c1a8e55d7bbe70bfd832e812ca60885ba97d
7
+ data.tar.gz: 7f208481a65c71fbd6541ae2a1abc231eed41347fe837d5540201c6f11d8df7df5754044d8fbe8bd0de20edc179b46df9ea24ae782177c915ae27512932edff8
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loadshedding
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kapil Raj Nakhwa (@xecutioner303)