@@ -8,25 +8,25 @@ def initialize(record, query)
88 def normalize
99 {
1010 # Core fields
11- ' title' => title ,
12- ' creators' => creators ,
13- ' source' => source ,
14- ' year' => year ,
15- ' format' => format ,
16- ' links' => links ,
17- ' citation' => citation ,
18- ' identifier' => record_id ,
19- ' summary' => summary ,
20- ' publisher' => publisher ,
21- ' location' => best_location ,
22- ' subjects' => subjects ,
11+ title : ,
12+ creators : ,
13+ source : ,
14+ year : ,
15+ format : ,
16+ links : ,
17+ citation : ,
18+ identifier : ,
19+ summary : ,
20+ publisher : ,
21+ location : ,
22+ subjects : ,
2323 # Primo-specific fields
24- ' container' => container_title ,
25- ' numbering' => numbering ,
26- ' chapter_numbering' => chapter_numbering ,
27- ' thumbnail' => thumbnail ,
28- ' availability' => best_availability ,
29- ' other_availability' => other_availability?
24+ container : ,
25+ numbering : ,
26+ chapter_numbering : ,
27+ thumbnail : ,
28+ availability : ,
29+ other_availability :
3030 }
3131 end
3232
@@ -115,7 +115,7 @@ def citation
115115 end
116116 end
117117
118- def container_title
118+ def container
119119 return unless @record [ 'pnx' ] [ 'addata' ]
120120
121121 if @record [ 'pnx' ] [ 'addata' ] [ 'jtitle' ] . present?
@@ -125,7 +125,7 @@ def container_title
125125 end
126126 end
127127
128- def record_id
128+ def identifier
129129 return unless @record [ 'pnx' ] [ 'control' ] [ 'recordid' ]
130130
131131 @record [ 'pnx' ] [ 'control' ] [ 'recordid' ] . join
@@ -224,7 +224,7 @@ def openurl
224224 if openurl_server == record_openurl_server
225225 construct_primo_openurl
226226 else
227- Rails . logger . warn "Alma openurl server mismatch. Expected #{ openurl_server } , but received #{ record_openurl_server } . (record ID: #{ record_id } )"
227+ Rails . logger . warn "Alma openurl server mismatch. Expected #{ openurl_server } , but received #{ record_openurl_server } . (record ID: #{ identifier } )"
228228 @record [ 'delivery' ] [ 'almaOpenurl' ]
229229 end
230230 end
@@ -265,7 +265,7 @@ def publisher
265265 @record [ 'pnx' ] [ 'addata' ] [ 'pub' ] . first
266266 end
267267
268- def best_location
268+ def location
269269 return unless @record [ 'delivery' ]
270270 return unless @record [ 'delivery' ] [ 'bestlocation' ]
271271
@@ -279,13 +279,13 @@ def subjects
279279 @record [ 'pnx' ] [ 'display' ] [ 'subject' ]
280280 end
281281
282- def best_availability
283- return unless best_location
282+ def availability
283+ return unless location
284284
285285 @record [ 'delivery' ] [ 'bestlocation' ] [ 'availabilityStatus' ]
286286 end
287287
288- def other_availability?
288+ def other_availability
289289 return unless @record [ 'delivery' ] [ 'bestlocation' ]
290290 return unless @record [ 'delivery' ] [ 'holding' ]
291291
@@ -302,9 +302,9 @@ def frbrized?
302302 end
303303
304304 def alma_record?
305- return false unless record_id
305+ return false unless identifier
306306
307- record_id . start_with? ( 'alma' )
307+ identifier . start_with? ( 'alma' )
308308 end
309309
310310 def dedup_url
0 commit comments