gillbus 0.14.7 → 0.14.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gillbus/structs/tariff.rb +11 -1
- data/lib/gillbus/version.rb +1 -1
- data/test/responses/searchTrips-prod.xml +3 -0
- data/test/search_trips_test.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce7396411cb4bf2058e6c40e7a469d6350c0885
|
4
|
+
data.tar.gz: 6ec0a889c095d6f75cae2d82eccc1f02782f7457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dac5cd82ea05419c5b0a86bf3ac5694a757c911d6ad926faa4b0f2410ed62b63755da0cec72b249f9668a6b2db79893d34233cd10eecc5205499eba0ced9e2b
|
7
|
+
data.tar.gz: c9cbc66a36ba713215caf96e36cde67406d718416e4b1e746f655715ac187d1b730c604285be1e00b6334dd976ba312a19970911481c240d1718907e5f37532f
|
@@ -44,7 +44,7 @@ class Gillbus
|
|
44
44
|
field :passenger_student_ticket
|
45
45
|
|
46
46
|
# => "..."
|
47
|
-
field :return_cause
|
47
|
+
field :return_cause, :string_with_possible_attributes
|
48
48
|
|
49
49
|
# => "66.61"
|
50
50
|
field :note
|
@@ -53,6 +53,16 @@ class Gillbus
|
|
53
53
|
def money(val)
|
54
54
|
Monetize.parse(val, doc[:_currency])
|
55
55
|
end
|
56
|
+
|
57
|
+
def string_with_possible_attributes(val)
|
58
|
+
[val].flatten.map do |value|
|
59
|
+
if value.kind_of? Hash
|
60
|
+
value['__content__']
|
61
|
+
else
|
62
|
+
value
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
56
66
|
end
|
57
67
|
|
58
68
|
end
|
data/lib/gillbus/version.rb
CHANGED
@@ -53,6 +53,8 @@
|
|
53
53
|
<PASSENGER_BIRTHDAY/>
|
54
54
|
<PASSENGER_ISIC_NUMBER/>
|
55
55
|
<PASSENGER_STUDENT_TICKET/>
|
56
|
+
<RETURN_CAUSE>cause 1</RETURN_CAUSE>
|
57
|
+
<RETURN_CAUSE id='asdasd'>cause 2</RETURN_CAUSE>
|
56
58
|
</TARIFF>
|
57
59
|
<POINT>
|
58
60
|
<NUMBER>0</NUMBER>
|
@@ -153,6 +155,7 @@
|
|
153
155
|
<PASSENGER_BIRTHDAY/>
|
154
156
|
<PASSENGER_ISIC_NUMBER/>
|
155
157
|
<PASSENGER_STUDENT_TICKET/>
|
158
|
+
<RETURN_CAUSE id='asdasd'>cause 1</RETURN_CAUSE>
|
156
159
|
</TARIFF>
|
157
160
|
<POINT>
|
158
161
|
<NUMBER>0</NUMBER>
|
data/test/search_trips_test.rb
CHANGED
@@ -87,6 +87,8 @@ class SearchTripsResponseTest < Minitest::Test
|
|
87
87
|
assert_equal ['Кофе', 'Wi-Fi'], response.trips.first.options
|
88
88
|
assert_equal false, response.trips[1].recommended
|
89
89
|
assert_equal true, response.trips.first.recommended
|
90
|
+
assert_equal ['cause 1', 'cause 2'], response.trips.first.tariffs.first.return_cause
|
91
|
+
assert_equal ['cause 1'], response.trips[1].tariffs.first.return_cause
|
90
92
|
end
|
91
93
|
|
92
94
|
def test_fields_parsing_bad_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.14.
|
4
|
+
version: 0.14.8
|
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-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|
@@ -308,3 +308,4 @@ test_files:
|
|
308
308
|
- test/session_login_test.rb
|
309
309
|
- test/test_helper.rb
|
310
310
|
- test/tickets_booking_test.rb
|
311
|
+
has_rdoc:
|