lib/service_adaptors/primo_source.rb in umlaut-3.0.0beta5 vs lib/service_adaptors/primo_source.rb in umlaut-3.0.0beta6
- old
+ new
@@ -28,10 +28,11 @@
class PrimoSource < PrimoService
# Overwrites PrimoService#new.
def initialize(config)
@service_types = ["holding"]
+ @source_attributes = []
super(config)
end
# Overwrites PrimoService#handle.
def handle(request)
@@ -49,9 +50,12 @@
# so we get the additional holdings and add them.
source.expand.each do |holding|
service_data = {}
@holding_attributes.each do |attr|
service_data[attr] = holding.method(attr).call
+ end
+ @source_attributes.each do |attr|
+ service_data[attr.to_sym] = holding.method(attr.to_sym).call
end
service_data.merge!({
:call_number => holding.call_number, :collection => holding.collection,
:collection_str => "#{holding.library} #{holding.collection}",
:coverage_str => holding.coverage.join("<br />"),