lib/socialcast/net_ldap_ext.rb in socialcast-1.2.1.RC1 vs lib/socialcast/net_ldap_ext.rb in socialcast-1.2.2
- old
+ new
@@ -4,18 +4,19 @@
# grab a *single* value of an attribute
# abstracts away ldap multivalue attributes
def grab(attribute)
attribute = begin
- attribute.classify.constantize
+ attribute.camelize.constantize
rescue NameError
attribute
end
case attribute
when Hash
- value = attribute.delete("value")
- value % Hash[attribute.map {|k,v| [k, grab(v)]}].symbolize_keys
+ dup_attribute = attribute.dup
+ value = dup_attribute.delete("value")
+ value % Hash[dup_attribute.map {|k,v| [k, grab(v)]}].symbolize_keys
when String
Array.wrap(self[attribute]).compact.first
when Class, Module
return nil unless attribute.respond_to?(:run)
attribute.run(self)