Class: SAML2::Organization

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

Instance Attribute Summary collapse

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods inherited from Base

#decrypt, from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

#initialize(name = nil, display_name = nil, url = nil) ⇒ Organization

Returns a new instance of Organization.



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

def initialize(name = nil, display_name = nil, url = nil)
  super()
  @name = LocalizedName.new("OrganizationName", name)
  @display_name = LocalizedName.new("OrganizationDisplayName", display_name)
  @url = LocalizedName.new("OrganizationURL", url)
end

Instance Attribute Details

#display_nameLocalizedName (readonly)

Returns:



10
11
12
# File 'lib/saml2/organization.rb', line 10

def display_name
  @display_name
end

#nameLocalizedName (readonly)

Returns:



10
11
12
# File 'lib/saml2/organization.rb', line 10

def name
  @name
end

#urlLocalizedName (readonly)

Returns:



10
11
12
# File 'lib/saml2/organization.rb', line 10

def url
  @url
end

Instance Method Details

#build(builder) ⇒ void

This method returns an undefined value.

Serialize this object to XML, as part of a larger document

Parameters:

  • builder (Nokogiri::XML::Builder)

    The builder helper object to serialize to.



27
28
29
30
31
32
33
# File 'lib/saml2/organization.rb', line 27

def build(builder)
  builder["md"].Organization do |organization|
    @name.build(organization)
    @display_name.build(organization)
    @url.build(organization)
  end
end

#from_xml(node) ⇒ void

This method returns an undefined value.

Parse an XML element into this object.

Parameters:

  • node (Nokogiri::XML::Element)


13
14
15
16
17
# File 'lib/saml2/organization.rb', line 13

def from_xml(node)
  name.from_xml(node.xpath("md:OrganizationName", Namespaces::ALL))
  display_name.from_xml(node.xpath("md:OrganizationDisplayName", Namespaces::ALL))
  url.from_xml(node.xpath("md:OrganizationURL", Namespaces::ALL))
end