apidae 1.4.4 → 1.4.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: b92a9500f041a825be642e53f3bc1497e6f3448d40a31185485fc0cc313d34a8
4
- data.tar.gz: 4fa5733460999f4c3a9558f35b3caf5ba94cbc5a0cf82fd4c83a953a25355001
3
+ metadata.gz: a61ea097b41173558021ee6eda38efaf0c472bcb192116c8957b822c58e72018
4
+ data.tar.gz: 86de5486f34f4f1498ea6a7558191a765dbf0293b175fa1485042f906551257f
5
5
  SHA512:
6
- metadata.gz: 7ff90b90ff0153f945b54382af7792be8ae9096b9c6e7fb4e345d15f5c044f0cf695d00ce9ea6c6716d576a4c2485387cd65e43a6718431d068e29309506aea7
7
- data.tar.gz: 84fac7d1042a47b33fe67a27eb19ad856b1896f03704b763f8da740f482cabb7a21413249361fe4908de36a1f5d3ff34c6751d31b91510f9dca8f762afa1983c
6
+ metadata.gz: 9da5479e9c3f93a80875c8746a48ac9a2ad8ff25788481dcd98f4347da487c78d5f62bc9bba823023c10ccd2e2f8865e81226d05d19a516844c67a052b8e3878
7
+ data.tar.gz: 6727ae118f54f37b47a42365a1e81044e985ff60b046e886ece950b7708085183c0ce5ef5836d466b101371d1351390362cffba60631393f1d116d9387b3de5a
@@ -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]) +
@@ -28,7 +28,7 @@ module Apidae
28
28
  LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments,
29
29
  :openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
30
30
  ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :accessibility_desc, :capacity, :telephone, :email, :website,
31
- :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
31
+ :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url, :instagram,
32
32
  :openings, :openings_extra, :rates, :services, :payment_methods, :categories, :themes,
33
33
  :labels, :chains, :classification, :challenged, :environments, :languages, :products,
34
34
  :animals, :equipments, :comfort, :activities, :promo, :internal, :linked]
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.4.4"
2
+ VERSION = "1.4.6"
3
3
  end