+ def describe(target)
+ # A generic version of describe_user/describe_domain that
+ # dispatches base on the class of the target.
+ if target.is_a?(User)
+ if user_exists(target) then
+ return describe_user(target)
+ else
+ return 'User not found'
+ end
+ elsif target.is_a?(Domain)
+ if domain_exists(target) then
+ return describe_domain(target)
+ else
+ return 'Domain not found'
+ end
+ else
+ raise NotImplementedError
+ end
+ end
+