Class: SamlIdp::NameIdFormatter
- Inherits:
-
Object
- Object
- SamlIdp::NameIdFormatter
- Defined in:
- lib/saml_idp/name_id_formatter.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
Instance Method Summary collapse
- #all ⇒ Object
- #chosen ⇒ Object
-
#initialize(list) ⇒ NameIdFormatter
constructor
A new instance of NameIdFormatter.
Constructor Details
#initialize(list) ⇒ NameIdFormatter
Returns a new instance of NameIdFormatter.
4 5 6 |
# File 'lib/saml_idp/name_id_formatter.rb', line 4 def initialize(list) self.list = (list || {}) end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
3 4 5 |
# File 'lib/saml_idp/name_id_formatter.rb', line 3 def list @list end |
Instance Method Details
#all ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/saml_idp/name_id_formatter.rb', line 8 def all if split? one_one.map { |key_val| build("1.1", key_val)[:name] } + two_zero.map { |key_val| build("2.0", key_val)[:name] } else list.map { |key_val| build("2.0", key_val)[:name] } end end |
#chosen ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/saml_idp/name_id_formatter.rb', line 17 def chosen if split? version, choose = "1.1", one_one.first version, choose = "2.0", two_zero.first unless choose version, choose = "2.0", "persistent" unless choose build(version, choose) else choose = list.first || "persistent" build("2.0", choose) end end |