Module: ActiveLdap::Attributes::ClassMethods

Defined in:
lib/active_ldap/attributes.rb

Instance Method Summary collapse

Instance Method Details

#attr_protected(*attributes) ⇒ Object



12
13
14
15
# File 'lib/active_ldap/attributes.rb', line 12

def attr_protected(*attributes)
  targets = attributes.collect {|attr| attr.to_s} - protected_attributes
  instance_variable_set("@attr_protected", targets)
end

#protected_attributesObject



17
18
19
20
21
# File 'lib/active_ldap/attributes.rb', line 17

def protected_attributes
  ancestors[0..(ancestors.index(Base))].inject([]) do |result, ancestor|
    result + ancestor.instance_eval {@attr_protected ||= []}
  end
end