Class: SAML2::Conditions::AudienceRestriction
- Defined in:
- lib/saml2/conditions.rb
Instance Attribute Summary collapse
-
#audience ⇒ Object
Returns the value of attribute audience.
Instance Method Summary collapse
- #build(builder) ⇒ Object
-
#initialize(audience) ⇒ AudienceRestriction
constructor
A new instance of AudienceRestriction.
- #valid?(options) ⇒ Boolean
Constructor Details
#initialize(audience) ⇒ AudienceRestriction
Returns a new instance of AudienceRestriction.
49 50 51 |
# File 'lib/saml2/conditions.rb', line 49 def initialize(audience) @audience = audience end |
Instance Attribute Details
#audience ⇒ Object
Returns the value of attribute audience.
47 48 49 |
# File 'lib/saml2/conditions.rb', line 47 def audience @audience end |
Instance Method Details
#build(builder) ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/saml2/conditions.rb', line 57 def build(builder) builder['saml'].AudienceRestriction do |builder| Array.wrap(audience).each do |single_audience| builder['saml'].Audience(single_audience) end end end |
#valid?(options) ⇒ Boolean
53 54 55 |
# File 'lib/saml2/conditions.rb', line 53 def valid?() Array.wrap(audience).include?([:audience]) ? :valid : :invalid end |