lib/treequel/branch.rb in treequel-1.2.1 vs lib/treequel/branch.rb in treequel-1.2.2
- old
+ new
@@ -52,10 +52,11 @@
### @param [Treequel::Directory] directory The directory object the Branch is from.
###
### @return [Treequel::Branch] The new branch object.
def self::new_from_entry( entry, directory )
entry = Treequel::HashUtilities.stringify_keys( entry )
+ Treequel.logger.debug "Creating Branch from entry: %p in directory: %p" % [ entry, directory ]
return self.new( directory, entry['dn'].first, entry )
end
#################################################################
@@ -80,10 +81,12 @@
@dn = dn
@entry = entry ? stringify_keys( entry ) : nil
@values = {}
@include_operational_attrs = self.class.include_operational_attrs?
+
+ self.log.debug "New branch (%s): entry = %p, directory = %p" % [ @dn, @entry, @directory ]
end
######
public
@@ -107,10 +110,11 @@
# Whether or not to include operational attributes when fetching the Branch's entry
predicate_attr :include_operational_attrs
alias_method :include_operational_attributes?, :include_operational_attrs?
+
### Change the DN the Branch uses to look up its entry.
###
### @param [String] newdn The new DN.
### @return [void]
def dn=( newdn )
@@ -790,11 +794,11 @@
### Convert the specified +object+ according to the Branch's directory's conversion rules,
### and return it.
def get_converted_attribute( attrsym, object )
if attribute = self.directory.schema.attribute_types[ attrsym ]
self.log.debug "converting %p object to a %p attribute" %
- [ attrsym, attribute.syntax.oid ]
+ [ attrsym, attribute.syntax.desc ]
return self.directory.convert_to_attribute( attribute.syntax.oid, object )
else
self.log.info "no attributeType for %p" % [ attrsym ]
return object.to_s
end
@@ -802,9 +806,10 @@
### Clear any cached values when the structural state of the object changes.
### @return [void]
def clear_caches
+ self.log.debug "Clearing entry and values caches."
@entry = nil
@values.clear
end