class OneLogin::RubySaml::AttributeService

SAML2 AttributeService. Auxiliary class to build the AttributeService of the SP Metadata

Attributes

attributes[R]
index[R]
name[R]

Public Class Methods

new() click to toggle source

Initializes the AttributeService, set the index value as 1 and an empty array as attributes

# File lib/onelogin/ruby-saml/attribute_service.rb, line 13
def initialize
  @index = "1"
  @attributes = []
end

Public Instance Methods

add_attribute(options={}) click to toggle source

Add an AttributeService @param options [Hash] AttributeService option values

add_attribute(
              :name => "Name",
              :name_format => "Name Format",
              :index => 1,
              :friendly_name => "Friendly Name",
              :attribute_value => "Attribute Value"
             )
# File lib/onelogin/ruby-saml/attribute_service.rb, line 52
def add_attribute(options={})
  attributes << options
end
configure(&block) click to toggle source
# File lib/onelogin/ruby-saml/attribute_service.rb, line 18
def configure(&block)
  instance_eval &block
end
configured?() click to toggle source

@return [Boolean] True if the AttributeService object has been initialized and set with the required values

(has attributes and a name)
# File lib/onelogin/ruby-saml/attribute_service.rb, line 24
def configured?
  @attributes.length > 0 && !@name.nil?
end
service_index(index) click to toggle source

Set an index to the service @param index [Integer] An index

# File lib/onelogin/ruby-saml/attribute_service.rb, line 38
def service_index(index)
  @index = index
end
service_name(name) click to toggle source

Set a name to the service @param name [String] The service name

# File lib/onelogin/ruby-saml/attribute_service.rb, line 31
def service_name(name)
  @name = name
end