lib/eloqua/builder/xml.rb in eloqua-1.1.1 vs lib/eloqua/builder/xml.rb in eloqua-1.1.2

- old
+ new

@@ -6,11 +6,11 @@ # This could (and likely should) be submitted as a patch for # the main builder class class Xml < ::Builder::XmlMarkup - include Eloqua::Builder::Templates + include ::Eloqua::Builder::Templates # XML Templates # For use with strings and integers may do strange # things on the SOAP server side if given a float @@ -36,10 +36,16 @@ end xml.arr(:int, element) end end + define_builder_template :member_array do |xml, array| + array.each do |element| + xml.array(:int, element) + end + end + # For use with add/remove membership define_builder_template :object do |xml, object_type, type, id| xml.tag!(object_type) do xml.object_type!(object_type) do xml.template!(:object_type, type) @@ -113,10 +119,10 @@ tag!("#{sym.to_s.pluralize.downcase}", *args, &block) end # Extend to allow default namespace def method_missing(sym, *args, &block) - if(@namespace && !args.first.kind_of?(Symbol)) + if(@namespace && !args.first.kind_of?(::Symbol)) args.unshift(sym.to_sym) sym = @namespace end super(sym, *args, &block) end