Sha256: 4bcfba3b4493ad24c7b30e686c4d8de435471863554e9d7f0b45c6cec8784b19

Contents?: true

Size: 953 Bytes

Versions: 14

Compression:

Stored size: 953 Bytes

Contents

module ActiveLdap
  module AttributeMethods
    module Write
      extend ActiveSupport::Concern

      included do
        attribute_method_suffix '='
      end

    protected
      def attribute=(attr, *args)
        return set_attribute(attr, args.first)
      end

      # set_attribute
      #
      # Set the value of the attribute called by method_missing?
      def set_attribute(name, value)
        real_name = to_real_attribute_name(name)
        _dn_attribute = nil
        valid_dn_attribute = true
        begin
          _dn_attribute = dn_attribute
        rescue DistinguishedNameInvalid
          valid_dn_attribute = false
        end
        if valid_dn_attribute and real_name == _dn_attribute
          real_name, value = register_new_dn_attribute(real_name, value)
        end
        raise UnknownAttribute.new(name) if real_name.nil?

        @data[real_name] = value
        @simplified_data = nil
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
activeldap-5.1.1 lib/active_ldap/attribute_methods/write.rb
activeldap-5.1.0 lib/active_ldap/attribute_methods/write.rb
activeldap-3.2.3 lib/active_ldap/attribute_methods/write.rb
powerhome-activeldap-3.2.3 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.6 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.5 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.4 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.3 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.2 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.1 lib/active_ldap/attribute_methods/write.rb
activeldap-4.0.0 lib/active_ldap/attribute_methods/write.rb
activeldap-3.2.2 lib/active_ldap/attribute_methods/write.rb
activeldap-3.2.1 lib/active_ldap/attribute_methods/write.rb
activeldap-3.2.0 lib/active_ldap/attribute_methods/write.rb