Class: SAML2::NameID::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/saml2/name_id.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allow_create, format) ⇒ Policy

Returns a new instance of Policy.



26
27
28
# File 'lib/saml2/name_id.rb', line 26

def initialize(allow_create, format)
  @allow_create, @format = allow_create, format
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



17
18
19
# File 'lib/saml2/name_id.rb', line 17

def format
  @format
end

Class Method Details

.from_xml(node) ⇒ Object



19
20
21
22
23
24
# File 'lib/saml2/name_id.rb', line 19

def self.from_xml(node)
  if node
    allow_create = node['AllowCreate'].nil? ? nil : node['AllowCreate'] == 'true'
    NameID::Policy.new(allow_create, node['Format'])
  end
end

Instance Method Details

#==(rhs) ⇒ Object



34
35
36
# File 'lib/saml2/name_id.rb', line 34

def ==(rhs)
  format == rhs.format && allow_create? == rhs.allow_create?
end

#allow_create?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/saml2/name_id.rb', line 30

def allow_create?
  @allow_create
end