alfa_insurance 0.1.7 → 0.1.8

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
  SHA256:
3
- metadata.gz: 327fc246f136f035e1af994457c57cff16005aa13222b4dff318deac30f47106
4
- data.tar.gz: 883756c8414cfd2942bfad5a00c9521a5c454d6de144874b192800d8b5e1e242
3
+ metadata.gz: f30d2c9487a5b98b05ad464b6974c0a9b953e4a2247b93960b30de715dd3ced7
4
+ data.tar.gz: 1782e81f6c597d3d2df3184021ee338d6bd68058059819da9684a1c009888ab9
5
5
  SHA512:
6
- metadata.gz: 5e23adf4a9a5397d03eb67cd3a41781ace6afd9d7a61fa73fb0fc99246abffef25318e2373b4b95db0663046a3e554be47681a9c421a0c2c59885b82c411dac6
7
- data.tar.gz: '0994d079e0bb9b72420f5fe2c9d10c23eedfb2fa96f9b78b1ef50bf6177aecfadd9b36780429e75e7474bfe4989a38a3158979c4cc06f290ec4def44e8abab94'
6
+ metadata.gz: b47b9fda867f42e6215e71ec23cc1d56b80d55a34997f833fa1558a234599f542e4b7a64569bf3c2fdebbd0176b9d195d651144dda818220d53ebc405103684b
7
+ data.tar.gz: d5d552a2c19c452b89b9a51c7d8637b9f586ee499ab49243eb8a452878621239a12a85da618bc46d701cb958e9a6d7208eccd167f7ac2a807f5a66529885b765
@@ -57,46 +57,50 @@ module AlfaInsurance
57
57
  xml.insuredBirthDate(insured_birth_date)
58
58
  xml.insuredTicketNumber(insured_ticket_number)
59
59
  xml.insuredCount(1)
60
- # xml.insuredDocumentType(insured_document_type)
61
- # xml.insuredDocumentNumber(insured_document_number)
62
60
  bus_segments.each_with_index do |segment, index|
63
61
  xml.busSegmentRouteNumber(seqNo: index) {
64
- xml.value(segment.route_number)
62
+ xml.value(segment.route_number) if present?(segment.route_number)
65
63
  }
66
64
  xml.busSegmentPlaceNumber(seqNo: index) {
67
- xml.value(segment.place_number)
65
+ xml.value(segment.place_number) if present?(segment.place_number)
68
66
  }
69
67
  xml.busSegmentDepartureStation(seqNo: index) {
70
- xml.value(segment.departure_station)
68
+ xml.value(segment.departure_station) if present?(segment.departure_station)
71
69
  }
72
70
  xml.busSegmentDepartureDate(seqNo: index) {
73
- xml.value(segment.departure_date)
71
+ xml.value(segment.departure_date) if present?(segment.departure_date)
74
72
  }
75
73
  xml.busSegmentDepartureTime(seqNo: index) {
76
- xml.value(segment.departure_time)
74
+ xml.value(segment.departure_time) if present?(segment.departure_time)
77
75
  }
78
76
  xml.busSegmentArrivalStation(seqNo: index) {
79
- xml.value(segment.arrival_station)
77
+ xml.value(segment.arrival_station) if present?(segment.arrival_station)
80
78
  }
81
79
  xml.busSegmentArrivalDate(seqNo: index) {
82
- xml.value(segment.arrival_date)
80
+ xml.value(segment.arrival_date) if present?(segment.arrival_date)
83
81
  }
84
82
  xml.busSegmentArrivalTime(seqNo: index) {
85
- xml.value(segment.arrival_time)
83
+ xml.value(segment.arrival_time) if present?(segment.arrival_time)
86
84
  }
87
85
  xml.busSegmentNumber(seqNo: index) {
88
- xml.value(segment.number)
86
+ xml.value(segment.number) if present?(segment.number)
89
87
  }
90
88
  end
91
89
  xml.busSegmentsCount(bus_segments.size)
92
90
  xml.ticketInformation {
93
- xml.ticketTotalValue(total_value.to_f)
94
- xml.ticketIssueDate(ticket_issue_date.iso8601)
95
- }
91
+ xml.ticketTotalValue(total_value.to_f)
92
+ xml.ticketIssueDate(ticket_issue_date.iso8601)
93
+ }
96
94
  xml.customerPhoneType 'MOBILE'
97
95
  xml.customerPhone customer_phone
98
96
  xml.customerEmail customer_email
99
97
  xml
100
98
  end
99
+
100
+ private
101
+
102
+ def present?(value)
103
+ !value.nil? && value != ''
104
+ end
101
105
  end
102
106
  end
@@ -1,3 +1,3 @@
1
1
  module AlfaInsurance
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alfa_insurance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Sviridov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon