lib/rsaml/assertion.rb
def validate
      # rule: if there are no statements there must be a subject
      if statements.length == 0 && subject.nil?
        raise ValidationError, "An assertion with no statements must have a subject"
      end
      
      # rule: if there is an authentication then there must be a subject
      statements.each do |statement|           
        if statement_classes.include?(statement.class)
          if subject.nil?
            raise ValidationError, "An assertion with an #{statement.class.name} must have a subject"
          else
            break
          end
        end
      end
    end
# Validate the assertion. This validates the structural integrity of the assertion, not the
# validity of the assertion itself. To "assert" the assertion use the assert method.
Validate the assertion. This validates the structural integrity of the assertion, not the
validity of the assertion itself. To "assert" the assertion use the assert method.
Validate the assertion . This validates the structural integrity of the assertion not the validity of the assertion itself . To " assert " the assertion use the assert method .
def validate
      if statements.length == 0 && subject.nil?
        raise ValidationError, "An assertion with no statements must have a subject"
      end
      statements.each do |statement|           
        if statement_classes.include?(statement.class)
          if subject.nil?
            raise ValidationError, "An assertion with an #{statement.class.name} must have a subject"
          else
            break
          end
        end
      end
    end
def validate if statements . length == 0 && subject . nil? raise ValidationError , "An assertion with no statements must have a subject" end statements . each do | statement | if statement_classes . include? ( statement . class ) if subject . nil? raise ValidationError , "An assertion with an #{statement.class.name} must have a subject" else break end end end end
Validate the assertion.
Validate the assertion .
# rule: if there are no statements there must be a subject # rule: if there is an authentication then there must be a subject