booking_locations 0.4.0 → 0.5.0

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
  SHA1:
3
- metadata.gz: 029924f70dc87fcb08c9f33b476bc3101063a08c
4
- data.tar.gz: 5c726d80592254586d8e7cf5304d41b210a4d81f
3
+ metadata.gz: 539fd819b4941dcbd0027147abf45d8e6061550b
4
+ data.tar.gz: c060eacb91f9da6b514f88f328154b4e387e897a
5
5
  SHA512:
6
- metadata.gz: fdcadd6d7bd368cc0d2d07f003d0b24189f123f011441f5a535e9e9b8e403acbc0b9853d60655eec04492f114416fe2e99db29d1141ad37df5304edb4eabaf16
7
- data.tar.gz: 561224c24ba26f81652c7e9bf66f5abcf97406e4f7c07aeb644d33fbc64079bcae571d097cef61ce42769a8d9b90a84dec97078cbd6d535e3ea8b10447ff1569
6
+ metadata.gz: 3cc408330e0afcb341a3bde19f809b9ef7b0c6f93a61251f0e0081e7f99963b977fe41e2c3b471d7f498ed0409ebb966aecc6ea931728a567846d123554c39ff
7
+ data.tar.gz: 952de21a2d951e62ffbc68fc47cd1b036d5b385b0240f024adaeb9d093847755d02b5568c1cb3975b6ce9b7447e729ff16daf699dc0efa128cbe4e180cf8d5c6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.5.0
2
+
3
+ * Return guider's name by ID
4
+ * Return location instance by ID
5
+
1
6
  ## 0.4.0
2
7
 
3
8
  * Support GlobalID identification
@@ -41,12 +41,18 @@ module BookingLocations
41
41
  @slots ||= @data['slots'].map { |slot| Slot.new(slot) }
42
42
  end
43
43
 
44
+ def guider_name_for(guider_id)
45
+ guiders.find { |guider| guider.id == guider_id }.name
46
+ end
47
+
48
+ def location_for(location_id)
49
+ return self if id == location_id
50
+
51
+ locations.find { |location| location.id == location_id }
52
+ end
53
+
44
54
  def name_for(location_id)
45
- if id == location_id
46
- name
47
- else
48
- locations.find { |location| location.id == location_id }.name
49
- end
55
+ location_for(location_id).name
50
56
  end
51
57
  end
52
58
  end
@@ -1,3 +1,3 @@
1
1
  module BookingLocations
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booking_locations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Lovell