wdw_sources 0.1.5 → 0.1.6

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
  SHA256:
3
- metadata.gz: 4afa0b0f0e23677d2be76840140678f0e53ce55576a7117a54490771e2260175
4
- data.tar.gz: dd7f862c2f326bba0a93d80b01d1506a93841a210ac69a648f496c4fdb867d17
3
+ metadata.gz: af4dce345954fdfb0f519f8d08adeb8957f212da046d18dc79f1c61a7fa13cbc
4
+ data.tar.gz: 44f993ac032e04b56e94b3c02b86eee1287dbcdede3bee00e427bee95f7d5d89
5
5
  SHA512:
6
- metadata.gz: b8d027d4e93702c33e9a22687a693780e2d89e17bee1fe35091d3e0325add9cc356301fb8aeeb09dacfd0c6bbc73fb4587780c9e1a62b9b238e7ff62b9f21fe0
7
- data.tar.gz: 2eed645636fc00d50636cbf5730eb2c63831e0f6aed758d1d7e6a2095dab2742b291a1297c27ca3511ad8c0a3a3c673299ef20ae5046b6aead9b98fce61151f4
6
+ metadata.gz: 3d0f9b3cb1ebcb9782f0c73567aab72831b8538e59f2d5709803bb99e845c98bbfea3c222b0121e2cd568a4e86b3945e73a2ac2603a0179b3a8f3b568a7125d5
7
+ data.tar.gz: 1e4883a7606721a759274d39c3ebaaaa7d548abf08ea729c95250fe7367b440d84464d61d3b8b5cdad796cc8832178ade44bce9aeae9a76fa9bd785bcd622690
@@ -10,23 +10,33 @@ module WdwSources
10
10
 
11
11
  tp_list = Touringplans.list_all(interest)
12
12
  tp_list.each do |tp_list_item|
13
- _cache_tp_place(tp_list_item, interest)
13
+ tp_list_item_venue_permalink = tp_list_item.venue_permalink
14
+ tp_list_item_permalink = tp_list_item.permalink
15
+
16
+ _cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
14
17
  end
15
18
  end
16
19
 
17
- def self._cache_tp_place(tp_list_item, interest)
18
- interest = interest.to_sym
20
+ def self._cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
21
+ return "Missing tp_list_item_venue_permalink" if tp_list_item_venue_permalink.to_s.length < 3
22
+ return "Missing tp_list_item_permalink" if tp_list_item_permalink.to_s.length < 3
23
+ return "Missing interest" if interest.to_s.length < 3
19
24
 
20
- cache_resources = {attractions: WdwSources::TouringplansAttraction,
21
- dining: WdwSources::TouringplansDiningVenue,
22
- hotels: WdwSources::TouringplansHotel
25
+ cache_resources = {"attractions" => WdwSources::TouringplansAttraction,
26
+ "dining" => WdwSources::TouringplansDiningVenue,
27
+ "hotels" => WdwSources::TouringplansHotel
23
28
  }
24
29
 
25
30
  cache_resource = cache_resources[interest]
26
- cache_item = cache_resource.find_or_create_by(permalink: tp_list_item.permalink)
31
+ cache_item = cache_resource.find_or_create_by(permalink: tp_list_item_permalink)
32
+
33
+ tp_item_full_record = Touringplans.show(tp_list_item_venue_permalink,interest, tp_list_item_permalink)
27
34
 
28
- tp_item_full_record = Touringplans.show(tp_list_item.venue_permalink,interest, tp_list_item.permalink)
29
- cache_item.update!(tp_item_full_record.to_h)
35
+ vp = {venue_permalink: tp_list_item_venue_permalink}
36
+ full_record_hash = vp.merge(tp_item_full_record.to_h)
37
+ cache_item.update!(full_record_hash)
38
+ # tp_item_full_record.to_h
39
+ cache_item
30
40
  end
31
41
 
32
42
  # def self.cache_all_hotels
@@ -1,3 +1,3 @@
1
1
  module WdwSources
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wdw_sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - captproton