2 require 'array_case_equality'
8 DEFAULTS = { :imageScaleMode => :scaleToFit }
10 def self.included(base)
14 def mono_slideshow_xml(albums, preferences={})
15 albums = [albums].flatten
16 merged_prefs = albums.size == 1 ? {:showAlbumsButton => 'false'} : {}
17 merged_prefs.merge!(preferences).reverse_merge!(DEFAULTS)
18 xml = Builder::XmlMarkup.new
19 xml.instruct! :xml, :version => '1.0', :encoding => 'utf-8'
21 xml.preferences(merged_prefs)
22 albums.each do |album|
23 album.slideshow_album_xml(xml)
33 def recursive_merge(h)
34 self.merge(h) {|key, _old, _new| if _old.class == Hash then _old.recursive_merge(_new) else _new end }
37 def recursive_merge!(h)
38 self.merge!(h) {|key, _old, _new| if _old.class == Hash then _old.recursive_merge!(_new) else _new end }