Module: ActiveLdap::AttributeMethods

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::AttributeMethods
Defined in:
lib/active_ldap/attribute_methods.rb,
lib/active_ldap/attribute_methods/read.rb,
lib/active_ldap/attribute_methods/dirty.rb,
lib/active_ldap/attribute_methods/query.rb,
lib/active_ldap/attribute_methods/write.rb,
lib/active_ldap/attribute_methods/before_type_cast.rb

Defined Under Namespace

Modules: BeforeTypeCast, Dirty, Query, Read, Write

Instance Method Summary collapse

Instance Method Details

#methods(singleton_methods = true) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/active_ldap/attribute_methods.rb', line 6

def methods(singleton_methods = true)
  target_names = entry_attribute.all_names
  target_names -= ['objectClass', 'objectClass'.underscore]
  super + target_names.uniq.collect do |attr|
    method_patterns = 
      if self.class.respond_to?(:attribute_method_patterns)
        # Support for ActiveModel >= 7.1.0
        self.class.attribute_method_patterns
      else
        # Support for ActiveModel < 7.1.0
        self.class.attribute_method_matchers
      end
    
    method_patterns.collect do |pattern|
      pattern.method_name(attr).to_sym
    end
  end.flatten
end