Sha256: 9733879e02b08b89b35113ec69661717e227e6f492521dbf6be8b6ba18142e36
Contents?: true
Size: 877 Bytes
Versions: 8
Compression:
Stored size: 877 Bytes
Contents
module Inch 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 children object.children.map do |o| Proxy.for(o) end end MANY_ATTRIBUTES_THRESHOLD = 5 def has_many_attributes? n = object.class_attributes.size + object.instance_attributes.size n > MANY_ATTRIBUTES_THRESHOLD end MANY_CHILDREN_THRESHOLD = 20 def has_many_children? children.size > MANY_CHILDREN_THRESHOLD end def namespace? true end def no_methods? !children.any?(&:method?) end def pure_namespace? children.all?(&:namespace?) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems