gillbus 0.16.2 → 0.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gillbus/get_bus_image.rb +10 -6
- data/lib/gillbus/structs/trip.rb +4 -1
- data/lib/gillbus/version.rb +1 -1
- data/test/get_bus_image_test.rb +22 -0
- data/test/responses/getBusImage.xml +6 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4752bad48472334e6b03417f14dad9c0fbac5b9
|
4
|
+
data.tar.gz: fe70727f580211a765a261682a911c8091551c1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea5a7e7f28c2943f9a1b8a09f3869ed97dcf0feedebe238a7ad790c711de9c673c405faf038acccdd2bec145cdc46af9c6c8260fb49dae08b5ecc3c0382df04
|
7
|
+
data.tar.gz: 7cebcbee8c8e71abd0968a079a385cee9e146891d69975a1fb94d6f7072f65740a71afa1c63786b8cfbff91af60a11722cb6782ac205cd47082b5873654050e0
|
@@ -5,9 +5,7 @@ class Gillbus
|
|
5
5
|
|
6
6
|
class Request < BaseRequest
|
7
7
|
|
8
|
-
def path; '/online2/
|
9
|
-
|
10
|
-
def method; :get end
|
8
|
+
def path; '/online2/getBusImage' end
|
11
9
|
|
12
10
|
# busId
|
13
11
|
# Уникальный ИД заказа, переданный при отложенной продаже.
|
@@ -21,10 +19,16 @@ class Gillbus
|
|
21
19
|
|
22
20
|
end
|
23
21
|
|
24
|
-
class
|
25
|
-
|
22
|
+
class Image
|
23
|
+
extend Fields
|
24
|
+
include UpdateAttrs
|
25
|
+
|
26
|
+
field :url
|
27
|
+
field :thumb_url
|
26
28
|
end
|
27
29
|
|
30
|
+
class Response < BaseResponse
|
31
|
+
field :images, [Image], key: 'IMAGE'
|
32
|
+
end
|
28
33
|
end
|
29
34
|
end
|
30
|
-
|
data/lib/gillbus/structs/trip.rb
CHANGED
@@ -44,6 +44,9 @@ class Gillbus
|
|
44
44
|
# => "VIP"
|
45
45
|
field :bus_class
|
46
46
|
|
47
|
+
# => "168689517A076A9AE0508E5B3557184F"
|
48
|
+
field :bus_id
|
49
|
+
|
47
50
|
# => true
|
48
51
|
field :has_transfer, :bool
|
49
52
|
|
@@ -141,7 +144,7 @@ class Gillbus
|
|
141
144
|
field :fake_time_in_road, :bool
|
142
145
|
|
143
146
|
field :redirect_url
|
144
|
-
|
147
|
+
|
145
148
|
# => "RUB"
|
146
149
|
field :currency
|
147
150
|
|
data/lib/gillbus/version.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class GetBusImageTest < Minitest::Test
|
4
|
+
|
5
|
+
def get_bus_image
|
6
|
+
Gillbus::GetBusImage::Response.parse_string(File.read('test/responses/getBusImage.xml'))
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_images_size
|
10
|
+
assert_equal(1, get_bus_image.images.size)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_url
|
14
|
+
url = 'https://s3-eu-central-1.amazonaws.com/gds-testing/ImagesBuses/46C13A4EA7C4453BE0530300F00ADDDD/IMG_1898.JPG'
|
15
|
+
assert_equal(url, get_bus_image.images.first.url)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_thumb_url
|
19
|
+
thumb_url = 'https://s3-eu-central-1.amazonaws.com/gds-testing/ImagesBuses/46C13A4EA7C4453BE0530300F00ADDDD/Thumb/_IMG_1898.JPG'
|
20
|
+
assert_equal(thumb_url, get_bus_image.images.first.thumb_url)
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<DATA>
|
2
|
+
<IMAGE>
|
3
|
+
<URL>https://s3-eu-central-1.amazonaws.com/gds-testing/ImagesBuses/46C13A4EA7C4453BE0530300F00ADDDD/IMG_1898.JPG</URL>
|
4
|
+
<THUMB_URL>https://s3-eu-central-1.amazonaws.com/gds-testing/ImagesBuses/46C13A4EA7C4453BE0530300F00ADDDD/Thumb/_IMG_1898.JPG</THUMB_URL>
|
5
|
+
</IMAGE>
|
6
|
+
</DATA>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gillbus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey "codesnik" Trofimenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|
@@ -211,6 +211,7 @@ files:
|
|
211
211
|
- test/cancel_order_test.rb
|
212
212
|
- test/error_test.rb
|
213
213
|
- test/find_order_test.rb
|
214
|
+
- test/get_bus_image_test.rb
|
214
215
|
- test/get_cities_test.rb
|
215
216
|
- test/get_countries_test.rb
|
216
217
|
- test/get_dates_new_test.rb
|
@@ -226,6 +227,7 @@ files:
|
|
226
227
|
- test/responses/cancelOrder.xml
|
227
228
|
- test/responses/error.xml
|
228
229
|
- test/responses/findOrder.xml
|
230
|
+
- test/responses/getBusImage.xml
|
229
231
|
- test/responses/getCities.xml
|
230
232
|
- test/responses/getCountries.xml
|
231
233
|
- test/responses/getOrderTicket.xml
|
@@ -280,6 +282,7 @@ test_files:
|
|
280
282
|
- test/cancel_order_test.rb
|
281
283
|
- test/error_test.rb
|
282
284
|
- test/find_order_test.rb
|
285
|
+
- test/get_bus_image_test.rb
|
283
286
|
- test/get_cities_test.rb
|
284
287
|
- test/get_countries_test.rb
|
285
288
|
- test/get_dates_new_test.rb
|
@@ -295,6 +298,7 @@ test_files:
|
|
295
298
|
- test/responses/cancelOrder.xml
|
296
299
|
- test/responses/error.xml
|
297
300
|
- test/responses/findOrder.xml
|
301
|
+
- test/responses/getBusImage.xml
|
298
302
|
- test/responses/getCities.xml
|
299
303
|
- test/responses/getCountries.xml
|
300
304
|
- test/responses/getOrderTicket.xml
|
@@ -318,3 +322,4 @@ test_files:
|
|
318
322
|
- test/session_login_test.rb
|
319
323
|
- test/test_helper.rb
|
320
324
|
- test/tickets_booking_test.rb
|
325
|
+
has_rdoc:
|