File tree 3 files changed +5
-30
lines changed
3 files changed +5
-30
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,11 @@ class Pass < ActiveRecord::Base
17
17
:barcodes ,
18
18
:beacons ,
19
19
:boarding_pass ,
20
- :coupon ,
21
20
:description ,
22
- :event_ticket ,
23
21
:expiration_date ,
24
22
:file_name ,
25
23
:foreground_color ,
26
24
:format_version ,
27
- :generic ,
28
25
:grouping_identifier ,
29
26
:header_fields ,
30
27
:label_color ,
@@ -42,7 +39,6 @@ class Pass < ActiveRecord::Base
42
39
:secondary_fields ,
43
40
:semantics ,
44
41
:sharing_prohibited ,
45
- :store_card ,
46
42
:suppress_strip_shine ,
47
43
:user_info ,
48
44
:voided ,
Original file line number Diff line number Diff line change @@ -129,17 +129,10 @@ def beacons
129
129
130
130
# Information specific to a boarding pass
131
131
# Returns a hash representing Pass.BoardingPass
132
+ # https://developer.apple.com/documentation/walletpasses/pass/boardingpass
133
+ # i.e {transitType: 'PKTransitTypeGeneric'}
132
134
def boarding_pass
133
- end
134
-
135
- # Information specific to a coupon
136
- # Returns a hash representing Pass.Coupon
137
- def coupon
138
- end
139
-
140
- # Information specific to an event ticket
141
- # Returns a hash representing Pass.EventTicket
142
- def event_ticket
135
+ { }
143
136
end
144
137
145
138
# Date and time the pass expires, must include
@@ -149,11 +142,6 @@ def event_ticket
149
142
def expiration_date
150
143
end
151
144
152
- # Information specific to a generic pass
153
- # Returns a hash representing Pass.Generic
154
- def generic
155
- end
156
-
157
145
# A key to identify group multiple passes together
158
146
# (e.g. a number of boarding passes for the same trip)
159
147
# Returns a String
@@ -179,11 +167,6 @@ def relevant_date
179
167
def semantics
180
168
end
181
169
182
- # Information specific to a store card
183
- # Returns a hash representing Pass.StoreCard
184
- def store_card
185
- end
186
-
187
170
# Display the strip image without a shine effect
188
171
# Returns a boolean
189
172
def suppress_strip_shine
Original file line number Diff line number Diff line change @@ -88,20 +88,14 @@ def generate_json_pass
88
88
else
89
89
pass [ :barcodes ] = @pass . barcodes
90
90
end
91
-
92
91
pass [ :appLaunchURL ] = @pass . app_launch_url if @pass . app_launch_url
93
92
pass [ :associatedStoreIdentifiers ] = @pass . associated_store_identifiers unless @pass . associated_store_identifiers . empty?
94
93
pass [ :beacons ] = @pass . beacons unless @pass . beacons . empty?
95
- pass [ :boardingPass ] = @pass . boarding_pass if @pass . boarding_pass
96
- pass [ :coupon ] = @pass . coupon if @pass . coupon
97
- pass [ :eventTicket ] = @pass . event_ticket if @pass . event_ticket
98
94
pass [ :expirationDate ] = @pass . expiration_date if @pass . expiration_date
99
- pass [ :generic ] = @pass . generic if @pass . generic
100
95
pass [ :groupingIdentifier ] = @pass . grouping_identifier if @pass . grouping_identifier
101
96
pass [ :nfc ] = @pass . nfc if @pass . nfc
102
97
pass [ :relevantDate ] = @pass . relevant_date if @pass . relevant_date
103
98
pass [ :semantics ] = @pass . semantics if @pass . semantics
104
- pass [ :store_card ] = @pass . store_card if @pass . store_card
105
99
pass [ :userInfo ] = @pass . user_info if @pass . user_info
106
100
107
101
pass [ @pass . pass_type ] = {
@@ -112,6 +106,8 @@ def generate_json_pass
112
106
backFields : @pass . back_fields
113
107
}
114
108
109
+ pass [ :boardingPass ] . merge ( @pass . boarding_pass ) if @pass . pass_type == :boardingPass && @pass . boarding_pass
110
+
115
111
File . write ( @temporary_path . join ( "pass.json" ) , pass . to_json )
116
112
end
117
113
You can’t perform that action at this time.
0 commit comments