Module: SAML2::IndexedObject

Included in:
AttributeConsumingService, Endpoint::Indexed
Defined in:
lib/saml2/indexed_object.rb

Defined Under Namespace

Classes: Array

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



5
6
7
# File 'lib/saml2/indexed_object.rb', line 5

def index
  @index
end

Instance Method Details

#build(builder) ⇒ Object



66
67
68
69
70
# File 'lib/saml2/indexed_object.rb', line 66

def build(builder, *)
  super
  builder.parent.children.last['index'] = index
  builder.parent.children.last['isDefault'] = default? if default_defined?
end

#default?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/saml2/indexed_object.rb', line 18

def default?
  !!@is_default
end

#default_defined?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/saml2/indexed_object.rb', line 22

def default_defined?
  !@is_default.nil?
end

#eql?(rhs) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/saml2/indexed_object.rb', line 12

def eql?(rhs)
  index == rhs.index &&
      default? == rhs.default? &&
      super
end

#from_xml(node) ⇒ Object



26
27
28
29
30
# File 'lib/saml2/indexed_object.rb', line 26

def from_xml(node)
  @index = node['index'] && node['index'].to_i
  @is_default = node['isDefault'] && node['isDefault'] == 'true'
  super
end

#initialize(*args) ⇒ Object



7
8
9
10
# File 'lib/saml2/indexed_object.rb', line 7

def initialize(*args)
  @is_default = nil
  super
end