ecm_opening_times 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c833435c635f3364eaefba2a3f8a91732bc5982d
4
- data.tar.gz: c79d633eb71b77726fe2c16cc5d3b1243f45844d
3
+ metadata.gz: 569b734f51ec9a5fe7e2ccba064fb2db30a5d9f2
4
+ data.tar.gz: 3ddf6427c88cd4a17d3ffe53b759a76482ac63ea
5
5
  SHA512:
6
- metadata.gz: fd15c3893cb3530e7cb5545a0ef976031ead6bd30af6253112893cf0b3d6a264fa5d0d7f0fc4f499c4bca7501d84148690683944805ee8c4ea7427955a82d914
7
- data.tar.gz: ad584a192281eda86f099b14ca7460638dbf459d0bc8a39cd808dc765e6b624a5973bc7355383ec627a62ed419acc60c3dc959bbfc942674fbd6a07a46d8ba91
6
+ metadata.gz: 4ff3b938c25bc43aef8abe7ac8118ad290e629b6dbfd2cf565bd39f28beed1544cd6f9fac29c3de877b575db307053832043f3f83203ea439f0abdd4368ade8c
7
+ data.tar.gz: be869ca4c431782e9596bac49136b5dd03fee1cb8bc8516d9c58ced666940ff73db62b1539292732ee84527a35341f137f4f7aed392193e75a5efe93d161695d
@@ -1,8 +1,14 @@
1
1
  module Ecm
2
2
  module OpeningTimes
3
3
  module ApplicationHelper
4
- def opening_times
5
- @branches = Ecm::OpeningTimes::Branch.all
4
+ def opening_times(options = {})
5
+ options.reverse_merge(branches: nil)
6
+ case options[:branches]
7
+ when Array, Symbol, String
8
+ @branches = Ecm::OpeningTimes::Branch.where(identifier: options[:branches]).all
9
+ else
10
+ @branches = Ecm::OpeningTimes::Branch.all
11
+ end
6
12
  render partial: 'ecm/opening_times/branches/opening_times', locals: { branches: @branches }
7
13
  end
8
14
  end
@@ -69,6 +69,10 @@ module Ecm::OpeningTimes
69
69
  open_all_day
70
70
  end
71
71
 
72
+ def human
73
+ "#{branch.name}: #{open_at} - #{close_at}"
74
+ end
75
+
72
76
  private
73
77
 
74
78
  def _time_to_minutes_since_midnight(hours, minutes)
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module OpeningTimes
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_opening_times
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails