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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61845bc4aeb464e25cb148d102974f9604d75222
4
- data.tar.gz: 5949f84580bcafae66d1fa56a438d08a6d0bd632
3
+ metadata.gz: c9ec4d134411b18ab82dd204351755d9134dc460
4
+ data.tar.gz: 1c5e9497ad029d1e971b4d18b2ea5e0c5c4c0982
5
5
  SHA512:
6
- metadata.gz: 72d7e603c0fc1730733ea74406d3d42986b05d7831ab36248bb895c875684ce6415369b32ae7b1be870c71ad5f01beb3cdc393c1fc1c309eb793efacecc9925b
7
- data.tar.gz: b2d57d4c4791e039b360dc3a027ea95d8fe239a20f90dd381b03a4e0c16749bca7749ea28796f595f3a5eec652a78c76ce446133be30d70e9900c2bd6db5490e
6
+ metadata.gz: 3e49925f4ff7ee27596134884339f222a0f15519c6edd4fc3943a1986250599e90d7a3a4e3440ab826eeb980c76b748d57382105696344060119e13959370de1
7
+ data.tar.gz: d340113730b7092c07e3ab2d12b3fd42e7da88f0a40c2100a57540e385c0e87f75d3eff32ba592bfa5f7edda00200122b89823d2063ec207f116d680b95da917
@@ -49,6 +49,8 @@ class Gillbus
49
49
  # => "66.61"
50
50
  field :note
51
51
 
52
+ field :is_exclusive_price, :bool
53
+
52
54
  parser do
53
55
  def money(val)
54
56
  Monetize.parse(val, doc[:_currency])
@@ -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
@@ -1,3 +1,3 @@
1
1
  class Gillbus
2
- VERSION = "0.15.2"
2
+ VERSION = "0.15.3"
3
3
  end
@@ -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>
@@ -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.2
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-24 00:00:00.000000000 Z
12
+ date: 2017-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_xml