Sha256: 438c94eff74eece1a0743cc4b92a4584bc7db890505e89ee534a287cc7fb2522

Contents?: true

Size: 654 Bytes

Versions: 14

Compression:

Stored size: 654 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

    protected

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

Version data entries

14 entries across 14 versions & 2 rubygems

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