Class: RSAML::AssertionIDRef
- Inherits:
-
Object
- Object
- RSAML::AssertionIDRef
- Includes:
- Validatable
- Defined in:
- lib/rsaml/assertion.rb
Overview
Reference to an assertion via ID
Instance Attribute Summary collapse
-
#id ⇒ Object
The ID 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(id) ⇒ AssertionIDRef
constructor
Initialize the AssertionIDRef with the given assertion ID.
-
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the assertion ID ref.
-
#validate ⇒ Object
Validate that the AssertionIDRef is structurally valid.
Methods included from Validatable
Constructor Details
#initialize(id) ⇒ AssertionIDRef
Initialize the AssertionIDRef with the given assertion ID
39 40 41 |
# File 'lib/rsaml/assertion.rb', line 39 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
The ID reference
36 37 38 |
# File 'lib/rsaml/assertion.rb', line 36 def id @id end |
Class Method Details
.from_xml(element) ⇒ Object
Construct an Action instance from the given XML Element or fragment.
54 55 56 57 |
# File 'lib/rsaml/assertion.rb', line 54 def self.from_xml(element) element = REXML::Document.new(element).root if element.is_a?(String) AssertionIDRef.new(element.text) end |
Instance Method Details
#to_xml(xml = Builder::XmlMarkup.new) ⇒ Object
Construct an XML fragment representing the assertion ID ref
49 50 51 |
# File 'lib/rsaml/assertion.rb', line 49 def to_xml(xml=Builder::XmlMarkup.new) xml.tag!('saml:AssertionIDRef', id) end |
#validate ⇒ Object
Validate that the AssertionIDRef is structurally valid
44 45 46 |
# File 'lib/rsaml/assertion.rb', line 44 def validate raise ValidationError, "An id is required" if id.nil? end |