Sha256: 8aec3b34cda6753ee4c159583c56c1d4153f035db4d15b4d3796a1e370468c4e

Contents?: true

Size: 651 Bytes

Versions: 11

Compression:

Stored size: 651 Bytes

Contents

module ActiveLdap
  module AttributeMethods
    extend ActiveSupport::Concern
    include ActiveModel::AttributeMethods

    def methods(singleton_methods = true)
      target_names = entry_attribute.all_names
      target_names -= ['objectClass', 'objectClass'.underscore]
      super + target_names.uniq.collect do |attr|
        self.class.attribute_method_matchers.collect do |matcher|
          :"#{matcher.prefix}#{attr}#{matcher.suffix}"
        end
      end.flatten
    end

    private
    # overiding ActiveModel::AttributeMethods
    def attribute_method?(method_name)
      have_attribute?(method_name, ['objectClass'])
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
activeldap-6.1.0 lib/active_ldap/attribute_methods.rb
activeldap-6.0.4 lib/active_ldap/attribute_methods.rb
activeldap-6.0.3 lib/active_ldap/attribute_methods.rb
activeldap-6.0.2 lib/active_ldap/attribute_methods.rb
activeldap-6.0.1 lib/active_ldap/attribute_methods.rb
activeldap-6.0.0 lib/active_ldap/attribute_methods.rb
activeldap-5.2.4 lib/active_ldap/attribute_methods.rb
activeldap-5.2.3 lib/active_ldap/attribute_methods.rb
activeldap-5.2.2 lib/active_ldap/attribute_methods.rb
activeldap-5.2.1 lib/active_ldap/attribute_methods.rb
activeldap-5.2.0 lib/active_ldap/attribute_methods.rb