Class: SAML::Core::RequestAbstract
- Inherits:
-
Object
- Object
- SAML::Core::RequestAbstract
- Defined in:
- lib/saml/core/request_abstract.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#issue_instant ⇒ Object
readonly
Returns the value of attribute issue_instant.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(clock_class = Time) ⇒ RequestAbstract
constructor
A new instance of RequestAbstract.
- #to_xml ⇒ Object
- #xml_document ⇒ Object
Constructor Details
#initialize(clock_class = Time) ⇒ RequestAbstract
Returns a new instance of RequestAbstract.
13 14 15 16 17 |
# File 'lib/saml/core/request_abstract.rb', line 13 def initialize(clock_class=Time) @id = UUID.new.generate @version = '2.0' @issue_instant = clock_class.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ") end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/saml/core/request_abstract.rb', line 7 def id @id end |
#issue_instant ⇒ Object (readonly)
Returns the value of attribute issue_instant.
9 10 11 |
# File 'lib/saml/core/request_abstract.rb', line 9 def issue_instant @issue_instant end |
#issuer ⇒ Object
Returns the value of attribute issuer.
11 12 13 |
# File 'lib/saml/core/request_abstract.rb', line 11 def issuer @issuer end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/saml/core/request_abstract.rb', line 8 def version @version end |
Instance Method Details
#to_xml ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/saml/core/request_abstract.rb', line 25 def to_xml xml = xml_document root = xml.root root.attributes['ID'] = @id root.attributes['IssueInstant'] = @issue_instant root.attributes['Version'] = @version unless @issuer.nil? issuer_node = root.add_element("saml:Issuer") issuer_node.text = @issuer end xml end |
#xml_document ⇒ Object
19 20 21 22 |
# File 'lib/saml/core/request_abstract.rb', line 19 def xml_document xml = Document.new root = xml.add_element("samlp:RequestAbstract") end |