gillbus 0.15.2 → 0.15.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/structs/tariff.rb +2 -0
- data/lib/gillbus/structs/trip_options.rb +15 -0
- data/lib/gillbus/version.rb +1 -1
- data/test/responses/searchTrips-prod.xml +5 -0
- data/test/search_trips_test.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9ec4d134411b18ab82dd204351755d9134dc460
|
4
|
+
data.tar.gz: 1c5e9497ad029d1e971b4d18b2ea5e0c5c4c0982
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e49925f4ff7ee27596134884339f222a0f15519c6edd4fc3943a1986250599e90d7a3a4e3440ab826eeb980c76b748d57382105696344060119e13959370de1
|
7
|
+
data.tar.gz: d340113730b7092c07e3ab2d12b3fd42e7da88f0a40c2100a57540e385c0e87f75d3eff32ba592bfa5f7edda00200122b89823d2063ec207f116d680b95da917
|
@@ -25,5 +25,20 @@ class Gillbus
|
|
25
25
|
# информация, отмеченная как "прочее"
|
26
26
|
field :other, [:string], root: 'OTHER', key: 'ITEM'
|
27
27
|
|
28
|
+
# признак рекламируемого рейса, передается как <PROMO><ITEM>ADVERTISING</ITEM></PROMO>
|
29
|
+
field :advertising, :adertising_bool, root: 'PROMO', key: 'ITEM'
|
30
|
+
|
31
|
+
# признак рекомендованого рейса, передается как <PROMO><ITEM>BUSFOR_RECOMMEND</ITEM></PROMO>
|
32
|
+
field :busfor_recommend, :recommend_bool, root: 'PROMO', key: 'ITEM'
|
33
|
+
|
34
|
+
parser do # better not to let flag value out of this gem
|
35
|
+
def adertising_bool(vals)
|
36
|
+
vals.include?('ADVERTISING')
|
37
|
+
end
|
38
|
+
|
39
|
+
def recommend_bool(vals)
|
40
|
+
vals.include?('BUSFOR_RECOMMEND')
|
41
|
+
end
|
42
|
+
end
|
28
43
|
end
|
29
44
|
end
|
data/lib/gillbus/version.rb
CHANGED
@@ -128,6 +128,10 @@
|
|
128
128
|
<ITEM>Трансфер</ITEM>
|
129
129
|
<ITEM>Cкидка при покупке раунд-трипа</ITEM>
|
130
130
|
</OTHER>
|
131
|
+
<PROMO>
|
132
|
+
<ITEM>BUSFOR_RECOMMEND</ITEM>
|
133
|
+
<ITEM>ADVERTISING</ITEM>
|
134
|
+
</PROMO>
|
131
135
|
</OPTIONS>
|
132
136
|
</TRIP>
|
133
137
|
<TRIP>
|
@@ -182,6 +186,7 @@
|
|
182
186
|
<PASSENGER_ISIC_NUMBER/>
|
183
187
|
<PASSENGER_STUDENT_TICKET/>
|
184
188
|
<RETURN_CAUSE id='asdasd'>cause 1</RETURN_CAUSE>
|
189
|
+
<IS_EXCLUSIVE_PRICE>true</IS_EXCLUSIVE_PRICE>
|
185
190
|
</TARIFF>
|
186
191
|
<POINT>
|
187
192
|
<NUMBER>0</NUMBER>
|
data/test/search_trips_test.rb
CHANGED
@@ -93,6 +93,7 @@ class SearchTripsResponseTest < Minitest::Test
|
|
93
93
|
assert_equal true, response.trips.first.recommended
|
94
94
|
assert_equal ['cause 1', 'cause 2'], response.trips.first.tariffs.first.return_cause
|
95
95
|
assert_equal ['cause 1'], response.trips[1].tariffs.first.return_cause
|
96
|
+
assert_equal true, response.trips[1].tariffs.first.is_exclusive_price
|
96
97
|
end
|
97
98
|
|
98
99
|
def test_options_parsing
|
@@ -134,6 +135,8 @@ class SearchTripsResponseTest < Minitest::Test
|
|
134
135
|
assert_equal critical_info, options.critical_info
|
135
136
|
assert_equal resource_options, options.resource_options
|
136
137
|
assert_equal other_options, options.other
|
138
|
+
assert options.advertising
|
139
|
+
assert options.busfor_recommend
|
137
140
|
end
|
138
141
|
|
139
142
|
def test_empty_options_parsing
|
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.15.
|
4
|
+
version: 0.15.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-08-
|
12
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_xml
|