From 88ded74b765abc38dbabf706bb9ce08cd3ec0e1b Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 16 Mar 2011 10:54:56 -0400 Subject: [PATCH] cleanup file --- lib/avm/image.rb | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/lib/avm/image.rb b/lib/avm/image.rb index d2190d2..112e285 100644 --- a/lib/avm/image.rb +++ b/lib/avm/image.rb @@ -7,8 +7,40 @@ require 'avm/observation' module AVM class Image DUBLIN_CORE_FIELDS = [ :title, :description ] - AVM_SINGLE_FIELDS = [ 'Distance.Notes', 'Spectral.Notes', 'ReferenceURL', 'Credit', 'Date', 'ID', 'Type', 'Image.ProductQuality' ] - AVM_SINGLE_METHODS = [ :distance_notes, :spectral_notes, :reference_url, :credit, :date, :id, :type, :quality ] + + AVM_SINGLE_FIELDS = [ + 'Distance.Notes', + 'Spectral.Notes', + 'ReferenceURL', + 'Credit', + 'Date', + 'ID', + 'Type', + 'Image.ProductQuality' + ] + + AVM_SINGLE_METHODS = [ + :distance_notes, + :spectral_notes, + :reference_url, + :credit, + :date, + :id, + :type, + :quality + ] + + AVM_SINGLE_MESSAGES = [ + :distance_notes, + :spectral_notes, + :reference_url, + :credit, + :string_date, + :id, + :image_type, + :image_quality + ] + AVM_SINGLES = AVM_SINGLE_FIELDS.zip(AVM_SINGLE_METHODS) attr_reader :creator, :observations @@ -38,7 +70,8 @@ module AVM refs[:photoshop].add_child(%{#{headline}}) - AVM_SINGLE_FIELDS.zip([distance_notes, spectral_notes, reference_url, credit, string_date, id, image_type, image_quality]).each do |tag, value| + AVM_SINGLE_FIELDS.zip(AVM_SINGLE_MESSAGES).each do |tag, message| + value = send(message) refs[:avm].add_child(%{#{value.to_s}}) if value end