lib/rsaml/conditions.rb
# Construct an XML fragment representing the conditions collection
Construct an XML fragment representing the conditions collection
Construct an XML fragment representing the conditions collection
def to_xml(xml=Builder::XmlMarkup.new)
      attributes = {}
      attributes['NotBefore'] = not_before.in_time_zone.xmlschema unless not_before.nil?
      attributes['NotOnOrAfter'] = not_on_or_after.in_time_zone.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
def to_xml ( xml = Builder :: XmlMarkup . new ) attributes = { } attributes [ 'NotBefore' ] = not_before . in_time_zone . xmlschema unless not_before . nil? attributes [ 'NotOnOrAfter' ] = not_on_or_after . in_time_zone . 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
Construct an XML fragment representing the conditions collection
Construct an XML fragment representing the conditions collection
xml
new