lib/mods_display/fields/location.rb in mods_display-0.0.1.beta3 vs lib/mods_display/fields/location.rb in mods_display-0.0.1.beta4

- old
+ new

@@ -1,24 +1,18 @@ class ModsDisplay::Location < ModsDisplay::Field - - def fields - return_values = [] - @value.each do |val| - return_values << ModsDisplay::Values.new(:label => label || location_label(val), :values => [val.text]) - end - return_values - end - + private - + + def displayLabel(element) + super(element) || location_label(element) || "Location" + end + def location_label(element) if element.attributes["type"].respond_to?(:value) && location_labels.has_key?(element.attributes["type"].value) location_labels[element.attributes["type"].value] - else - "Location" end end - + def location_labels {"repository" => "Repository"} end end \ No newline at end of file