Method: RSAML::Conditions#to_xml

Defined in:
lib/rsaml/conditions.rb

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

Construct an XML fragment representing the conditions collection



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/rsaml/conditions.rb', line 71

def to_xml(xml=Builder::XmlMarkup.new)
  attributes = {}
  attributes['NotBefore'] = not_before.xmlschema unless not_before.nil?
  attributes['NotOnOrAfter'] = not_on_or_after.xmlschema unless not_on_or_after.nil?
  xml.tag!('saml:Conditions', attributes) {
    conditions.each { |condition| xml << condition.to_xml }
    audience_restrictions.each do |audience|
      xml.tag!('saml:AudienceRestriction') { xml << audience.to_xml }
    end
    xml.tag!('OneTimeUse') if one_time_use
    xml << proxy_restriction.to_xml unless proxy_restriction.nil?
  }
end