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 +4 -4
- data/lib/alfa_insurance/insurance.rb +18 -14
- data/lib/alfa_insurance/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30d2c9487a5b98b05ad464b6974c0a9b953e4a2247b93960b30de715dd3ced7
|
4
|
+
data.tar.gz: 1782e81f6c597d3d2df3184021ee338d6bd68058059819da9684a1c009888ab9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
94
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2018-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|