Class: Saml::Kit::Conditions
- Inherits:
-
Object
- Object
- Saml::Kit::Conditions
- Includes:
- XmlParseable
- Defined in:
- lib/saml/kit/conditions.rb
Constant Summary
Constants included from XmlParseable
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
- #audiences ⇒ Object
- #expired_at ⇒ Object
-
#initialize(node) ⇒ Conditions
constructor
A new instance of Conditions.
- #started_at ⇒ Object
Methods included from XmlParseable
#present?, #to_h, #to_s, #to_xhtml, #to_xml
Constructor Details
#initialize(node) ⇒ Conditions
Returns a new instance of Conditions.
10 11 12 13 |
# File 'lib/saml/kit/conditions.rb', line 10 def initialize(node) @to_nokogiri = node @content = node.to_s end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
8 9 10 |
# File 'lib/saml/kit/conditions.rb', line 8 def content @content end |
Instance Method Details
#audiences ⇒ Object
23 24 25 |
# File 'lib/saml/kit/conditions.rb', line 23 def audiences search('./saml:AudienceRestriction/saml:Audience').map(&:text) end |
#expired_at ⇒ Object
19 20 21 |
# File 'lib/saml/kit/conditions.rb', line 19 def expired_at parse_iso8601(at_xpath('./@NotOnOrAfter').try(:value)) end |
#started_at ⇒ Object
15 16 17 |
# File 'lib/saml/kit/conditions.rb', line 15 def started_at parse_iso8601(at_xpath('./@NotBefore').try(:value)) end |