Class: RSAML::Statement::AttributeStatement

Inherits:
Base
  • Object
show all
Defined in:
lib/rsaml/statement/attribute_statement.rb

Overview

The assertion subject is associated with the supplied attributes.

Instance Attribute Summary

Attributes inherited from Base

#type

Instance Method Summary collapse

Instance Method Details

#attributesObject

Specifies attributes of the assertion subject.



6
7
8
# File 'lib/rsaml/statement/attribute_statement.rb', line 6

def attributes
  @attributes ||= []
end

#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object

Construct an XML fragment representing the authentication statement



20
21
22
23
24
# File 'lib/rsaml/statement/attribute_statement.rb', line 20

def to_xml(xml=Builder::XmlMarkup.new)
  xml.tag!('saml:AttributeStatement') {
    attributes.each { |attribute| xml << attribute.to_xml }
  }
end

#validateObject

Validate the structure of the attribute statement. Raises a validation error if:

  • Has no attributes specified

  • Any of the attributes are invalid

Raises:



14
15
16
17
# File 'lib/rsaml/statement/attribute_statement.rb', line 14

def validate
  raise ValidationError, "At least one attribute must be specified" if @attributes.empty?
  @attributes.each { |attribute| attribute.validate }
end