def server_object_mask
    if parameters[:object_mask] && !parameters[:object_mask].empty?

      # Reduce the masks found in this object to a minimal set
      #
      # If you pass the API a mask that asks for the same property twice (within
      # the same type scope), the API treats it as an error (and throws an exception)
      #
      # We get around that by parsing the various masks that have been given to us
      # merging their properties where possible, thereby removing the duplicates
      # from the mask that actually gets passed to the server. As a side benefit,
      # the mask we send to the server will be streamlined; without too many extraneous
      # characters
      reduced_masks = parameters[:object_mask].inject([]) do |merged_masks, object_mask|
        mergeable_mask = merged_masks.find { |mask| mask.can_merge_with? object_mask }
        if mergeable_mask
          mergeable_mask.merge object_mask
        else
          merged_masks.push object_mask
        end

        merged_masks
      end

      if reduced_masks.count == 1
        reduced_masks[0].to_s
      else
        "[#{reduced_masks.collect{|mask| mask.to_s}.join(',')}]"
      end
    else
      nil
    end
  end
def server_object_mask
    if parameters[:object_mask] && !parameters[:object_mask].empty?

      # Reduce the masks found in this object to a minimal set
      #
      # If you pass the API a mask that asks for the same property twice (within
      # the same type scope), the API treats it as an error (and throws an exception)
      #
      # We get around that by parsing the various masks that have been given to us
      # merging their properties where possible, thereby removing the duplicates
      # from the mask that actually gets passed to the server. As a side benefit,
      # the mask we send to the server will be streamlined; without too many extraneous
      # characters
      reduced_masks = parameters[:object_mask].inject([]) do |merged_masks, object_mask|
        mergeable_mask = merged_masks.find { |mask| mask.can_merge_with? object_mask }
        if mergeable_mask
          mergeable_mask.merge object_mask
        else
          merged_masks.push object_mask
        end

        merged_masks
      end

      if reduced_masks.count == 1
        reduced_masks[0].to_s
      else
        "[#{reduced_masks.collect{|mask| mask.to_s}.join(',')}]"
      end
    else
      nil
    end
  end
A utility method that returns the object mask (if any) stored
 in this parameter set.