level_travel 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/level_travel/search/request.rb +32 -0
- data/lib/level_travel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5955c3217ef6975f8e6aef4df6e15fe6c2d9d4dc59f34aeaea60a171a47c8e87
|
4
|
+
data.tar.gz: 9d384e0fba3208744e7d47ec7a75dd06db429b3aa40a25e556ad54815ea1f61e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a44dbe6fdc88844c84fcfec3de7a8a1d004e79aa0a9ef142def3aca5114ffa1936411d3a0b2424d064b6fbb692d4c8d0ec2271ae4d53299eefbc277d649d2f0
|
7
|
+
data.tar.gz: 53ca507a50692163cb0afd98c58ca295378f832d80cf7ea3e92ad8abd9cc25e3b96ad3d050c8b2300053cad0dc5d7275fbc0e63d110b7e33d8b478350a863f9e
|
@@ -10,8 +10,40 @@ module LevelTravel
|
|
10
10
|
|
11
11
|
# @param request_id [String] Request ID from the `enqueue` request
|
12
12
|
def self.status(request_id)
|
13
|
+
# TODO: return an object like { succeeded: [], failed: [] }
|
13
14
|
::LevelTravel::Request.get('/search/status', request_id: request_id)
|
14
15
|
end
|
16
|
+
|
17
|
+
# @param request_id [String] Request ID from the `enqueue` request
|
18
|
+
# @param operator_ids [Array<Integer>] Operators' IDs. Succeeded IDs from the result of status request.
|
19
|
+
def self.get_grouped_hotels(request_id, operator_ids: [])
|
20
|
+
params = prepare_params(operator_ids: operator_ids)
|
21
|
+
|
22
|
+
::LevelTravel::Request.get('/search/get_grouped_hotels', request_id: request_id, **params)
|
23
|
+
end
|
24
|
+
|
25
|
+
# :reek:BooleanParameter
|
26
|
+
# :reek:LongParameterList
|
27
|
+
# @param request_id [String] Request ID from the `enqueue` request
|
28
|
+
# @param hotel_id [String] Hotel ID from the `get_grouped_hotels` request
|
29
|
+
# @param operator_ids [Array<Integer>] Operators' IDs. Succeeded IDs from the result of status request.
|
30
|
+
# @param compact [Boolean] Return tours without additional information if it's true.
|
31
|
+
def self.get_hotel_offers(request_id, hotel_id:, operator_ids: [], compact: false)
|
32
|
+
params = prepare_params(operator_ids: operator_ids, compact: compact)
|
33
|
+
|
34
|
+
::LevelTravel::Request.get('/search/get_hotel_offers', request_id: request_id, hotel_id: hotel_id, **params)
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param operator_ids [Array<Integer>] Operators' IDs. Succeeded IDs from the result of status request.
|
38
|
+
# @param other_params [Hash]
|
39
|
+
def self.prepare_params(operator_ids:, **other_params)
|
40
|
+
params = other_params
|
41
|
+
params = params.merge(operator_ids: operator_ids.join(',')) if operator_ids.any?
|
42
|
+
|
43
|
+
params
|
44
|
+
end
|
45
|
+
|
46
|
+
private_class_method :prepare_params
|
15
47
|
end
|
16
48
|
end
|
17
49
|
end
|
data/lib/level_travel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: level_travel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Rodionov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|