lib/rsaml/protocol/query/attribute_query.rb
def validate
          matched = {}
          duplicated_attributes = []
          attributes.each do |attribute|
            if matched.has_key?(attribute.name) && matched[attribute.name] == attribute.name_format
              duplicated_attributes << attribute.name unless duplicated_attributes.include?(attribute.name)
            else
              matched[attribute.name] = attribute.name_format
            end
          end
          if !duplicated_attributes.empty?
            raise ValidationError, "An attribute with the same name and name format may only be specified once. The following attributes were specified multiple times: #{duplicated_attributes.join(',')}"
          end
        end
# Validate the structure of the attribute query.
Validate the structure of the attribute query.
Validate the structure of the attribute query .
def validate
          matched = {}
          duplicated_attributes = []
          attributes.each do |attribute|
            if matched.has_key?(attribute.name) && matched[attribute.name] == attribute.name_format
              duplicated_attributes << attribute.name unless duplicated_attributes.include?(attribute.name)
            else
              matched[attribute.name] = attribute.name_format
            end
          end
          if !duplicated_attributes.empty?
            raise ValidationError, "An attribute with the same name and name format may only be specified once. The following attributes were specified multiple times: #{duplicated_attributes.join(',')}"
          end
        end
def validate matched = { } duplicated_attributes = [ ] attributes . each do | attribute | if matched . has_key? ( attribute . name ) && matched [ attribute . name ] == attribute . name_format duplicated_attributes << attribute . name unless duplicated_attributes . include? ( attribute . name ) else matched [ attribute . name ] = attribute . name_format end end if ! duplicated_attributes . empty? raise ValidationError , "An attribute with the same name and name format may only be specified once. The following attributes were specified multiple times: #{duplicated_attributes.join(',')}" end end
Validate the structure of the attribute query.
Validate the structure of the attribute query .