apidae 1.4.4 → 1.4.5

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: b92a9500f041a825be642e53f3bc1497e6f3448d40a31185485fc0cc313d34a8
4
- data.tar.gz: 4fa5733460999f4c3a9558f35b3caf5ba94cbc5a0cf82fd4c83a953a25355001
3
+ metadata.gz: 5993f5c75ce5af62a6bfb8ac53a4f4ae0e07536fa9ac532686a88966461edfc5
4
+ data.tar.gz: 0e015ab1ffaf6af58f709e3dc1662f50200422ae5551b9dcf2a790b67050d249
5
5
  SHA512:
6
- metadata.gz: 7ff90b90ff0153f945b54382af7792be8ae9096b9c6e7fb4e345d15f5c044f0cf695d00ce9ea6c6716d576a4c2485387cd65e43a6718431d068e29309506aea7
7
- data.tar.gz: 84fac7d1042a47b33fe67a27eb19ad856b1896f03704b763f8da740f482cabb7a21413249361fe4908de36a1f5d3ff34c6751d31b91510f9dca8f762afa1983c
6
+ metadata.gz: a4f0e9122f14fc19c07145963b11d4ed1a2edbae80ef8045d6277e3613fa2be478c6e36c89f794dd60a97f4e6eff049eaf59657da8219e454d14a7795a39d57c
7
+ data.tar.gz: ae9c7c1697a424a83e151bbbee9e47e918473c951e16f53c4780d8b9b83085aa7623af3e596f722866e790f16018e751600c71c89f4b8964b059a665176b5b38
@@ -12,6 +12,7 @@ module Apidae
12
12
  FAX = 202
13
13
  MOBILE_WEBSITE = 3769
14
14
  SHORTY_URL = 4923
15
+ INSTAGRAM = 7221
15
16
 
16
17
  CONTACTS_MAP = {
17
18
  'telephone' => PHONE,
@@ -24,7 +25,8 @@ module Apidae
24
25
  'yelp' => YELP,
25
26
  'fax' => FAX,
26
27
  'mobile_website' => MOBILE_WEBSITE,
27
- 'shorty_url' => SHORTY_URL
28
+ 'shorty_url' => SHORTY_URL,
29
+ 'instagram' => INSTAGRAM
28
30
  }
29
31
 
30
32
  MODE_AUTO = 'auto'
@@ -177,37 +179,13 @@ module Apidae
177
179
  when PHONE, ALT_PHONE
178
180
  contact_details[:telephone] ||= {}
179
181
  contact_details[:telephone][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
180
- when EMAIL
181
- contact_details[:email] ||= {}
182
- contact_details[:email][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
183
- when WEBSITE
184
- contact_details[:website] ||= {}
185
- contact_details[:website][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
186
- when GOOGLE
187
- contact_details[:google] ||= {}
188
- contact_details[:google][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
189
- when FACEBOOK
190
- contact_details[:facebook] ||= {}
191
- contact_details[:facebook][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
192
- when TWITTER
193
- contact_details[:twitter] ||= {}
194
- contact_details[:twitter][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
195
- when YELP
196
- contact_details[:yelp] ||= {}
197
- contact_details[:yelp][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
198
- when TRIP_ADVISOR
199
- contact_details[:trip_advisor] ||= {}
200
- contact_details[:trip_advisor][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
201
- when FAX
202
- contact_details[:fax] ||= {}
203
- contact_details[:fax][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
204
- when MOBILE_WEBSITE
205
- contact_details[:mobile_website] ||= {}
206
- contact_details[:mobile_website][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
207
- when SHORTY_URL
208
- contact_details[:shorty_url] ||= {}
209
- contact_details[:shorty_url][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
210
182
  else
183
+ contacts_refs_by_code = CONTACTS_MAP.invert
184
+ if contacts_refs_by_code.keys.include?(c[:type][:id])
185
+ contact_ref = contacts_refs_by_code[c[:type][:id]].to_sym
186
+ contact_details[contact_ref] ||= {}
187
+ contact_details[contact_ref][c[:identifiant]] = {value: c[:coordonnees][:fr], description: c.dig(:observation, :libelleFr)}
188
+ end
211
189
  end
212
190
  end
213
191
  end
@@ -282,7 +260,7 @@ module Apidae
282
260
  categories: lists_ids(data_hash[:categories], data_hash[:typesDetailles], data_hash[:activiteCategories], data_hash[:typesHabitation]),
283
261
  themes: lists_ids(data_hash[:themes]),
284
262
  capacity: (data_hash[:capacite] || {})
285
- .merge(presta_hash ? {group_min: presta_hash[:tailleGroupeMin], group_max: presta_hash[:tailleGroupeMax],
263
+ .merge(presta_hash ? {group_min: (presta_hash[:nombrePersonnesMinimum] || presta_hash[:tailleGroupeMin]), group_max: presta_hash[:tailleGroupeMax],
286
264
  age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax],
287
265
  wheelchair_max: presta_hash[:nombrePersonnesEnFauteuilRoulantAccueilliesSimultanement]} : {}),
288
266
  classification: nodes_ids(data_hash[:classement], data_hash[:classementPrefectoral], data_hash[:classification]) +
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.4.4"
2
+ VERSION = "1.4.5"
3
3
  end