lib/inch/code_object/proxy/namespace_object.rb in inch-0.2.2 vs lib/inch/code_object/proxy/namespace_object.rb in inch-0.2.3
- old
+ new
@@ -2,9 +2,15 @@
module CodeObject
module Proxy
# a namespace object can have methods and other namespace objects
# inside itself (e.g. classes and modules)
class NamespaceObject < Base
+ def child(name)
+ if children
+ children.detect { |child| child.name == name }
+ end
+ end
+
def children
object.children.map do |o|
Proxy.for(o)
end
end