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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71781ccc6cc539c77331613ce955a9f66322f9f7
4
- data.tar.gz: 2941844d92f3c64e3dab76ef4c23bf23570be725
3
+ metadata.gz: f4752bad48472334e6b03417f14dad9c0fbac5b9
4
+ data.tar.gz: fe70727f580211a765a261682a911c8091551c1b
5
5
  SHA512:
6
- metadata.gz: 154b813152b361ab42470df580b0fdf9083cc1ff446da5816c1284378126502f7c16144a6c62888492db2ea6aa11f71c15b728ed9167c7062bfe4e9aa4c49a10
7
- data.tar.gz: fcb742e04abfd1fc72f10d7b6ad78365fc36c1329aecf687f60a0b4082175c0da8f793783d51b5f4855828d6c7f7399fcb9399f1131dd5e0d82b6b51a9e0b44a
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/GetBusImage' end
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 Response < BaseResponse
25
- field :image_urls, [:string], key: 'URL'
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
-
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  class Gillbus
2
- VERSION = "0.16.2"
2
+ VERSION = "0.16.3"
3
3
  end
@@ -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.2
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-10-19 00:00:00.000000000 Z
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: