sitra_client 0.3.0 → 0.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0357752f2b5a6ceea65913ff05f25ecdf05785f4
|
4
|
+
data.tar.gz: 2d9cbd8d81777d4669a97147ce0b0cb4b9cb0b84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f27cb33f878af6242e9d3846ab8ba4d04886640ff45f26937be823b36caacca3dcb81f7758c2abb63974870526027de2d71ea49a5385b5af397059b384f850
|
7
|
+
data.tar.gz: 1e73ba1a62c41c73867677c06ca5993f13b1f4433b6599f99d136315b195e201d704be1ed8a7851024c1fef31f0f6b5d68dc3fe09c120286b4c082a7aa4ea81f
|
data/lib/sitra_client.rb
CHANGED
@@ -31,6 +31,7 @@ module SitraClient
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.query(criteria, all_results = false)
|
34
|
+
query_result = {}
|
34
35
|
if all_results
|
35
36
|
loops = 0
|
36
37
|
criteria[:first] = 0
|
@@ -42,11 +43,15 @@ module SitraClient
|
|
42
43
|
criteria[:first] += MAX_COUNT
|
43
44
|
results += get_response(criteria).as_array
|
44
45
|
end
|
46
|
+
query_result[:count] = response.results_count
|
47
|
+
query_result[:results] = results
|
45
48
|
else
|
46
49
|
response = get_response(criteria)
|
47
50
|
results = response.as_array
|
51
|
+
query_result[:count] = response.results_count
|
52
|
+
query_result[:results] = results
|
48
53
|
end
|
49
|
-
|
54
|
+
query_result
|
50
55
|
end
|
51
56
|
|
52
57
|
private
|
@@ -90,8 +90,9 @@ class TouristicObject
|
|
90
90
|
@informations.merge(specific_information)
|
91
91
|
end
|
92
92
|
|
93
|
-
def
|
94
|
-
(@illustrations.nil? || @illustrations.empty?) ?
|
93
|
+
def pictures
|
94
|
+
(@illustrations.nil? || @illustrations.empty?) ? [{}] :
|
95
|
+
@illustrations.collect {|i| i[:traductionFichiers][0].keep_if {|k, v| k.to_s.start_with?('url')}}
|
95
96
|
end
|
96
97
|
|
97
98
|
def service_provider
|
@@ -202,7 +203,7 @@ class TouristicObject
|
|
202
203
|
end
|
203
204
|
end
|
204
205
|
|
205
|
-
def
|
206
|
+
def multimedias
|
206
207
|
@multimedias
|
207
208
|
end
|
208
209
|
|
data/lib/sitra_client/version.rb
CHANGED
@@ -46,12 +46,12 @@ class TouristicObjectTest < Test::Unit::TestCase
|
|
46
46
|
should 'populate image details' do
|
47
47
|
hash_result = {
|
48
48
|
:illustrations => [
|
49
|
-
{:type =>
|
49
|
+
{:type => 'IMAGE', :traductionFichiers => [{:url => 'my/image/url', :urlListe => 'my/list/url', :urlFiche => 'my/details/url'}]}
|
50
50
|
]
|
51
51
|
}
|
52
52
|
touristic_object = TouristicObject.new(hash_result)
|
53
53
|
|
54
|
-
assert_equal 'my/image/url', touristic_object.
|
54
|
+
assert_equal [{:url => 'my/image/url', :urlListe => 'my/list/url', :urlFiche => 'my/details/url'}], touristic_object.pictures
|
55
55
|
end
|
56
56
|
|
57
57
|
should 'populate address details' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitra_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeanbaptistevilain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|