Class: Inch::CodeObject::Proxy::NamespaceObject
- Defined in:
- lib/inch/code_object/proxy/namespace_object.rb
Overview
a namespace object can have methods and other namespace objects inside itself (e.g. classes and modules)
Direct Known Subclasses
Constant Summary collapse
- MANY_ATTRIBUTES_THRESHOLD =
5
- MANY_CHILDREN_THRESHOLD =
20
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#attributes ⇒ Object
The wording is a bit redundant, but this means the class and instance attributes of the namespace.
- #has_many_attributes? ⇒ Boolean
- #has_many_children? ⇒ Boolean
- #has_methods? ⇒ Boolean
- #pure_namespace? ⇒ Boolean
Methods inherited from Base
#[], #alias?, #aliased_object, #api_tag?, #children, #constant?, #core?, #depth, #docstring, #evaluation, #filename, #files, #fullname, #has_alias?, #has_children?, #has_code_example?, #has_doc?, #has_multiple_code_examples?, #has_unconsidered_tags?, #in_root?, #initialize, #inspect, #marshal_dump, #marshal_load, #method?, #name, #namespace?, #nodoc?, #original_docstring, #parent, #private?, #protected?, #public?, #source, #tagged_as_internal_api?, #tagged_as_private?, #type, #unconsidered_tag_count, #undocumented?, #visibility
Constructor Details
This class inherits a constructor from Inch::CodeObject::Proxy::Base
Instance Method Details
#attributes ⇒ Object
The wording is a bit redundant, but this means the class and instance attributes of the namespace
9 10 11 |
# File 'lib/inch/code_object/proxy/namespace_object.rb', line 9 def attributes self[:attributes] end |
#has_many_attributes? ⇒ Boolean
14 15 16 |
# File 'lib/inch/code_object/proxy/namespace_object.rb', line 14 def has_many_attributes? attributes.size > MANY_ATTRIBUTES_THRESHOLD end |
#has_many_children? ⇒ Boolean
19 20 21 |
# File 'lib/inch/code_object/proxy/namespace_object.rb', line 19 def has_many_children? children.size > MANY_CHILDREN_THRESHOLD end |
#has_methods? ⇒ Boolean
23 24 25 |
# File 'lib/inch/code_object/proxy/namespace_object.rb', line 23 def has_methods? children.any?(&:method?) end |
#pure_namespace? ⇒ Boolean
27 28 29 |
# File 'lib/inch/code_object/proxy/namespace_object.rb', line 27 def pure_namespace? children.all?(&:namespace?) end |