class DynamicsCRM::Metadata::PropertiesExpression

Attributes

properties[RW]

Public Class Methods

new(properties=[]) click to toggle source
# File lib/dynamics_crm/metadata/properties_expression.rb, line 7
def initialize(properties=[])
  @properties = properties
end

Public Instance Methods

to_xml(options={}) click to toggle source
# File lib/dynamics_crm/metadata/properties_expression.rb, line 11
def to_xml(options={})
  namespace = options[:namespace] ? options[:namespace] + ":" : ""

  property_set = ''
  if @properties.any?
    property_set = %Q{<#{namespace}PropertyNames xmlns:e="http://schemas.microsoft.com/2003/10/Serialization/Arrays">}
    @properties.each do |name|
      property_set << "<e:string>#{name}</e:string>"
    end
    property_set << "</#{namespace}PropertyNames>"
  end

  %Q{<#{namespace}Properties>
       <#{namespace}AllProperties>#{property_set.empty?}</#{namespace}AllProperties>
       #{property_set}
     </#{namespace}Properties>}
end