Class: RSAML::Statement::AttributeStatement
- 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
Instance Method Summary collapse
-
#attributes ⇒ Object
Specifies attributes of the assertion subject.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the authentication statement.
-
#validate ⇒ Object
Validate the structure of the attribute statement.
Instance Method Details
#attributes ⇒ Object
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 |
#validate ⇒ Object
Validate the structure of the attribute statement. Raises a validation error if:
-
Has no attributes specified
-
Any of the attributes are invalid
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 |