Class: SamlAuthenticatable::SamlMappedAttributes
- Inherits:
-
Object
- Object
- SamlAuthenticatable::SamlMappedAttributes
- Defined in:
- lib/devise_saml_authenticatable/saml_mapped_attributes.rb
Instance Method Summary collapse
-
#initialize(attributes, attribute_map) ⇒ SamlMappedAttributes
constructor
A new instance of SamlMappedAttributes.
- #resource_keys ⇒ Object
- #saml_attribute_keys ⇒ Object
- #value_by_resource_key(key) ⇒ Object
- #value_by_saml_attribute_key(key) ⇒ Object
Constructor Details
#initialize(attributes, attribute_map) ⇒ SamlMappedAttributes
Returns a new instance of SamlMappedAttributes.
3 4 5 6 7 |
# File 'lib/devise_saml_authenticatable/saml_mapped_attributes.rb', line 3 def initialize(attributes, attribute_map) @attributes = attributes @attribute_map = attribute_map @inverted_attribute_map = @attribute_map.invert end |
Instance Method Details
#resource_keys ⇒ Object
13 14 15 |
# File 'lib/devise_saml_authenticatable/saml_mapped_attributes.rb', line 13 def resource_keys @attribute_map.values end |
#saml_attribute_keys ⇒ Object
9 10 11 |
# File 'lib/devise_saml_authenticatable/saml_mapped_attributes.rb', line 9 def saml_attribute_keys @attribute_map.keys end |
#value_by_resource_key(key) ⇒ Object
17 18 19 |
# File 'lib/devise_saml_authenticatable/saml_mapped_attributes.rb', line 17 def value_by_resource_key(key) value_by_saml_attribute_key(@inverted_attribute_map.fetch(String(key))) end |
#value_by_saml_attribute_key(key) ⇒ Object
21 22 23 |
# File 'lib/devise_saml_authenticatable/saml_mapped_attributes.rb', line 21 def value_by_saml_attribute_key(key) @attributes[String(key)] end |