Class: SAML2::NameID
- Inherits:
-
Object
- Object
- SAML2::NameID
- Defined in:
- lib/saml2/name_id.rb
Defined Under Namespace
Modules: Format Classes: Policy
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #==(rhs) ⇒ Object
- #build(builder, options = {}) ⇒ Object
-
#initialize(id = nil, format = nil) ⇒ NameID
constructor
A new instance of NameID.
Constructor Details
#initialize(id = nil, format = nil) ⇒ NameID
Returns a new instance of NameID.
45 46 47 |
# File 'lib/saml2/name_id.rb', line 45 def initialize(id = nil, format = nil) @id, @format = id, format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
39 40 41 |
# File 'lib/saml2/name_id.rb', line 39 def format @format end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
39 40 41 |
# File 'lib/saml2/name_id.rb', line 39 def id @id end |
Class Method Details
.from_xml(node) ⇒ Object
41 42 43 |
# File 'lib/saml2/name_id.rb', line 41 def self.from_xml(node) node && new(node.content.strip, node['Format']) end |
Instance Method Details
#==(rhs) ⇒ Object
49 50 51 |
# File 'lib/saml2/name_id.rb', line 49 def ==(rhs) id == rhs.id && format == rhs.format end |
#build(builder, options = {}) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/saml2/name_id.rb', line 53 def build(builder, = {}) args = {} args['Format'] = format if format args['xmlns:saml'] = Namespaces::SAML if [:include_namespace] builder['saml'].__send__(.delete(:element) || 'NameID', id, args) end |