Class: RSAML::AssertionURIRef
- Inherits:
-
Object
- Object
- RSAML::AssertionURIRef
- Includes:
- Validatable
- Defined in:
- lib/rsaml/assertion.rb
Overview
Reference to an assertion via URI
Instance Attribute Summary collapse
-
#uri ⇒ Object
The URI reference.
Attributes included from Validatable
Class Method Summary collapse
-
.from_xml(element) ⇒ Object
Construct an Action instance from the given XML Element or fragment.
Instance Method Summary collapse
-
#initialize(uri) ⇒ AssertionURIRef
constructor
Initialize the AssertionURIRef with the given URI.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the assertion uri ref.
-
#validate ⇒ Object
Validate that the AssertionURIRef is structurally valid.
Methods included from Validatable
Constructor Details
#initialize(uri) ⇒ AssertionURIRef
Initialize the AssertionURIRef with the given URI
10 11 12 |
# File 'lib/rsaml/assertion.rb', line 10 def initialize(uri) @uri = uri end |
Instance Attribute Details
#uri ⇒ Object
The URI reference
7 8 9 |
# File 'lib/rsaml/assertion.rb', line 7 def uri @uri end |
Class Method Details
.from_xml(element) ⇒ Object
Construct an Action instance from the given XML Element or fragment.
25 26 27 28 |
# File 'lib/rsaml/assertion.rb', line 25 def self.from_xml(element) element = REXML::Document.new(element).root if element.is_a?(String) AssertionURIRef.new(element.text) end |
Instance Method Details
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the assertion uri ref
20 21 22 |
# File 'lib/rsaml/assertion.rb', line 20 def to_xml(xml=Builder::XmlMarkup.new) xml.tag!('saml:AssertionURIRef', uri) end |
#validate ⇒ Object
Validate that the AssertionURIRef is structurally valid
15 16 17 |
# File 'lib/rsaml/assertion.rb', line 15 def validate raise ValidationError, "A URI is required" if uri.nil? end |