Sha256: 245539e2efc9cde246d2c886f218b5d92f24dbfe5df622017e2658eaa8bfd0d2
Contents?: true
Size: 1.11 KB
Versions: 14
Compression:
Stored size: 1.11 KB
Contents
module Saml module ComplexTypes module AttributeType extend ActiveSupport::Concern include Saml::Base included do register_namespace "saml", Saml::SAML_NAMESPACE register_namespace 'ext', Saml::ATTR_EXT_NAMESPACE attribute :name, String, tag: 'Name' attribute :format, String, tag: 'NameFormat' attribute :friendly_name, String, tag: 'FriendlyName' attribute :original_issuer, String, tag: 'ext:OriginalIssuer' attribute :last_modified, Time, tag: 'ext:LastModified', on_save: lambda { |val| val.utc.xmlschema if val.present? } has_many :attribute_values, Saml::Elements::AttributeValue validates :name, presence: true end def initialize(*args) options = args.extract_options! @attribute_values ||= [] super(*(args << options)) end def attribute_value=(value) attribute_value = if value.is_a? String Saml::Elements::AttributeValue.new(content: value) else value end self.attribute_values = [attribute_value] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems