apidae 1.2.33 → 1.2.35

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: 4b734a86f74580f550511355efe321a11d760d140c9bfcc42bca846ea30706a4
4
- data.tar.gz: 696d2b99eed6646d84320f239a7edb94edb3e2f6faa7b82891d90e7c8bf7d95a
3
+ metadata.gz: 0ab6ee3f3a2d8930bc4d486e7de657f1fb408e69f0faf9b49e01921241210b02
4
+ data.tar.gz: 8c7637a88153f8befc3d3b94569f60afad0caf19235fc128b5302b104109bc1e
5
5
  SHA512:
6
- metadata.gz: 97545275be12c00ba5c803a624b7c5f35efa1121405acb7b3059cdc8795de97cf3ff51225eb1e26d032459fbd4cca3a8509e37496c4b021b645fbf865f042268
7
- data.tar.gz: 6b44066754d0a2010b6cf5301ab61f337974f1dbde0739dce1fef461bafe8d9a8cb1d5354b179c3a08faaf72873080128b6f0561963f41198650c89257839a0d
6
+ metadata.gz: 3f27a28ff6f954de764937f484ce844113acc6f642c2ba7f6eab37889f80c979ad92f4ddd0c13263017280678f969f83ff0920a4ac315306237bbefc75d35114
7
+ data.tar.gz: 75b2bb35a5d82be0b16019e4f55e1b804e69aa8cbe496d8f240dfb8dff7771d6f24a9c0150841ea389a80182f5b5851e56cb0b50c27ad11c1b50d470f3d94cb0
@@ -112,13 +112,14 @@ module Apidae
112
112
  owner_data
113
113
  end
114
114
 
115
- def self.parse_desc_data(data_hash, private_data, *locales)
115
+ def self.parse_desc_data(data_hash, private_data, presta_data, *locales)
116
116
  unless data_hash.blank?
117
117
  {
118
118
  short_desc: node_value(data_hash, :descriptifCourt, *locales),
119
119
  long_desc: node_value(data_hash, :descriptifDetaille, *locales),
120
120
  theme_desc: data_hash[:descriptifsThematises].blank? ? {} : Hash[data_hash[:descriptifsThematises].map {|th| [node_id(th, :theme), node_value(th, :description, *locales)]}],
121
- private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], (node_value(d, :descriptif, *locales).blank? ? {LOCALE_FR => d[:libelleFr]} : node_value(d, :descriptif, *locales))]}]
121
+ private_desc: private_data.blank? ? {} : Hash[private_data.map {|d| [d[:nomTechnique], (node_value(d, :descriptif, *locales).blank? ? {LOCALE_FR => d[:libelleFr]} : node_value(d, :descriptif, *locales))]}],
122
+ accessibility_desc: presta_data.blank? ? {} : Hash[presta_data.select {|k, v| k.to_s.start_with?('descriptifHandicap')}.map {|k, v| [k, node_value(presta_data, k, *locales)]}]
122
123
  }
123
124
  end
124
125
  end
@@ -279,7 +280,8 @@ module Apidae
279
280
  themes: lists_ids(data_hash[:themes]),
280
281
  capacity: (data_hash[:capacite] || {})
281
282
  .merge(presta_hash ? {group_min: presta_hash[:tailleGroupeMin], group_max: presta_hash[:tailleGroupeMax],
282
- age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax]} : {}),
283
+ age_min: presta_hash[:ageMin], age_max: presta_hash[:ageMax],
284
+ wheelchair_max: presta_hash[:nombrePersonnesEnFauteuilRoulantAccueilliesSimultanement]} : {}),
283
285
  classification: nodes_ids(data_hash[:classement], data_hash[:classementPrefectoral], data_hash[:classification]) +
284
286
  lists_ids(data_hash[:classementsGuides]) + lists_ids(data_hash[:classements]),
285
287
  classification_date: data_hash[:dateClassement],
@@ -314,7 +316,8 @@ module Apidae
314
316
  type_data_hash ? type_data_hash[:activitesSportives] : [],
315
317
  type_data_hash ? type_data_hash[:activitesCulturelles] : []),
316
318
  challenged: lists_ids(data_hash[:tourismesAdaptes]),
317
- languages: lists_ids(data_hash[:languesParlees])
319
+ languages: lists_ids(data_hash[:languesParlees]),
320
+ documentation_languages: lists_ids(data_hash[:languesDocumentation])
318
321
  }
319
322
  end
320
323
  end
@@ -362,9 +365,9 @@ module Apidae
362
365
  entity_hash = {}
363
366
  if information_hash
364
367
  if information_hash[:structureGestion]
365
- entity_hash.merge!({entity_id: information_hash[:structureGestion][:id], entity_name: information_hash[:structureGestion][:nom][:libelleFr],
368
+ entity_hash.merge!({entity_id: information_hash[:structureGestion][:id], entity_name: information_hash[:structureGestion].dig(:nom, :libelleFr),
366
369
  info_entity_id: (information_hash[:structureInformation] || information_hash[:structureGestion])[:id],
367
- info_entity_name: (information_hash[:structureInformation] || information_hash[:structureGestion])[:nom][:libelleFr],
370
+ info_entity_name: (information_hash[:structureInformation] || information_hash[:structureGestion]).dig(:nom, :libelleFr),
368
371
  service_provider_id: node_id(type_data_hash, :prestataireActivites)})
369
372
  end
370
373
 
@@ -11,7 +11,7 @@ module Apidae
11
11
 
12
12
  store_accessor :title_data, :title
13
13
  store_accessor :owner_data, :owner_name, :owner_id, :polls
14
- store_accessor :description_data, :short_desc, :long_desc, :theme_desc, :private_desc
14
+ store_accessor :description_data, :short_desc, :long_desc, :theme_desc, :private_desc, :accessibility_desc
15
15
  store_accessor :pictures_data, :pictures
16
16
  store_accessor :attachments_data, :attachments
17
17
  store_accessor :type_data, :categories, :themes, :capacity, :classification, :classification_date,
@@ -23,7 +23,7 @@ module Apidae
23
23
  store_accessor :location_data, :address, :place, :latitude, :longitude, :access, :territories, :environments, :altitude, :map_reference
24
24
  store_accessor :openings_data, :openings_desc, :openings_desc_mode, :openings, :time_periods, :openings_extra
25
25
  store_accessor :rates_data, :rates_desc, :rates_desc_mode, :rates, :payment_methods, :includes, :excludes, :rates_extra, :tax_included
26
- store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages
26
+ store_accessor :service_data, :services, :equipments, :comfort, :activities, :challenged, :languages, :documentation_languages
27
27
  store_accessor :booking_data, :booking_desc, :booking_entities, :visits_allowed, :visits_desc, :visits_duration, :visits_services
28
28
  store_accessor :tags_data, :promo, :internal, :linked
29
29
  store_accessor :version_data, :versioned_fields
@@ -179,7 +179,7 @@ module Apidae
179
179
  apidae_obj.apidae_type = object_data[:type]
180
180
  apidae_obj.apidae_subtype = ApidaeDataParser.node_id(object_data[type_fields[:node]], type_fields[:subtype])
181
181
  apidae_obj.title_data = ApidaeDataParser.parse_title(object_data, *locales)
182
- apidae_obj.description_data = ApidaeDataParser.parse_desc_data(object_data[:presentation], object_data[:donneesPrivees], *locales)
182
+ apidae_obj.description_data = ApidaeDataParser.parse_desc_data(object_data[:presentation], object_data[:donneesPrivees], object_data[:prestations], *locales)
183
183
  apidae_obj.contact_data = ApidaeDataParser.parse_contact_data(object_data[:informations], object_data[:contacts])
184
184
  apidae_obj.location_data = ApidaeDataParser.parse_location_data(object_data[:localisation], object_data[type_fields[:node]],
185
185
  object_data[:territoires])
@@ -27,7 +27,7 @@ module Apidae
27
27
 
28
28
  LOCALIZED_FIELDS = [:title, :short_desc, :long_desc, :pictures, :attachments,
29
29
  :openings_desc, :rates_desc, :includes, :excludes, :extra, :booking_desc]
30
- ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :capacity, :telephone, :email, :website,
30
+ ALL_FIELDS = LOCALIZED_FIELDS + [:theme_desc, :private_desc, :accessibility_desc, :capacity, :telephone, :email, :website,
31
31
  :google, :facebook, :twitter, :yelp, :trip_advisor, :fax, :mobile_website, :shorty_url,
32
32
  :openings, :openings_extra, :rates, :services, :payment_methods, :categories, :themes,
33
33
  :labels, :chains, :classification, :challenged, :environments, :languages, :products,
@@ -1,3 +1,3 @@
1
1
  module Apidae
2
- VERSION = "1.2.33"
2
+ VERSION = "1.2.35"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.33
4
+ version: 1.2.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-28 00:00:00.000000000 Z
11
+ date: 2023-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails