Class: YARD::CodeObjects::ModuleObject
- Inherits:
-
NamespaceObject
- Object
- Base
- NamespaceObject
- YARD::CodeObjects::ModuleObject
- Defined in:
- lib/yard/code_objects/module_object.rb
Overview
Represents a Ruby module.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#aliases ⇒ Hash
inherited
from NamespaceObject
readonly
A hash containing two keys, :class and :instance, each containing a hash of objects and their alias names.
-
#attributes ⇒ Hash
inherited
from NamespaceObject
readonly
A hash containing two keys, class and instance, each containing the attribute name with a { :read, :write } hash for the read and write objects respectively.
-
#base_docstring ⇒ Docstring
inherited
from Base
readonly
The non-localized documentation string associated with the object.
-
#child(opts = {}) ⇒ Base?
inherited
from NamespaceObject
Looks for a child that matches the attributes specified by
opts
. -
#children ⇒ Array<Base>
inherited
from NamespaceObject
readonly
The list of objects defined in this namespace.
-
#class_attributes ⇒ Hash
inherited
from NamespaceObject
Only the class attributes.
-
#class_mixins ⇒ Array<ModuleObject>
inherited
from NamespaceObject
readonly
Class mixins.
-
#constants(opts = {}) ⇒ Array<ConstantObject>
inherited
from NamespaceObject
Returns all constants in the namespace.
-
#cvars ⇒ Array<ClassVariableObject>
inherited
from NamespaceObject
Returns class variables defined in this namespace.
-
#dynamic ⇒ Boolean
inherited
from Base
Marks whether or not the method is conditionally defined at runtime.
-
#files ⇒ Array<String>
inherited
from Base
readonly
The files the object was defined in.
-
#group ⇒ String
inherited
from Base
The group this object is associated with.
-
#groups ⇒ Array<String>
inherited
from NamespaceObject
A list of ordered group names inside the namespace.
-
#included_constants ⇒ Array<ConstantObject>
inherited
from NamespaceObject
Returns constants included from any mixins.
-
#included_meths(opts = {}) ⇒ Object
inherited
from NamespaceObject
Returns methods included from any mixins that match the attributes specified by
opts
. -
#instance_attributes ⇒ Hash
inherited
from NamespaceObject
Only the instance attributes.
-
#instance_mixins ⇒ Array<ModuleObject>
inherited
from NamespaceObject
readonly
Instance mixins.
-
#meths(opts = {}) ⇒ Array<MethodObject>
inherited
from NamespaceObject
Returns all methods that match the attributes specified by
opts
. -
#mixins(*scopes) ⇒ Array<ModuleObject>
inherited
from NamespaceObject
Returns for specific scopes.
-
#namespace ⇒ NamespaceObject
(also: #parent)
inherited
from Base
The namespace the object is defined in.
-
#signature ⇒ String
inherited
from Base
The one line signature representing an object.
-
#source ⇒ String?
inherited
from Base
The source code associated with the object.
-
#source_type ⇒ Symbol
inherited
from Base
Language of the source code associated with the object.
-
#visibility ⇒ Symbol
inherited
from Base
The visibility of an object (:public, :private, :protected).
Instance Method Summary collapse
-
#inheritance_tree(include_mods = false) ⇒ Array<NamespaceObject>
Returns the inheritance tree of mixins.
Constructor Details
This class inherits a constructor from YARD::CodeObjects::NamespaceObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class YARD::CodeObjects::Base
Instance Attribute Details
#aliases ⇒ Hash (readonly) Originally defined in class NamespaceObject
A hash containing two keys, :class and :instance, each containing a hash of objects and their alias names.
#attributes ⇒ Hash (readonly) Originally defined in class NamespaceObject
A hash containing two keys, class and instance, each containing the attribute name with a { :read, :write } hash for the read and write objects respectively.
#base_docstring ⇒ Docstring (readonly) Originally defined in class Base
The non-localized documentation string associated with the object
#child(opts = {}) ⇒ Base? Originally defined in class NamespaceObject
Looks for a child that matches the attributes specified by
opts
.
#children ⇒ Array<Base> (readonly) Originally defined in class NamespaceObject
The list of objects defined in this namespace
#class_attributes ⇒ Hash Originally defined in class NamespaceObject
Only the class attributes
#class_mixins ⇒ Array<ModuleObject> (readonly) Originally defined in class NamespaceObject
Class mixins
#constants(opts = {}) ⇒ Array<ConstantObject> Originally defined in class NamespaceObject
Returns all constants in the namespace
#cvars ⇒ Array<ClassVariableObject> Originally defined in class NamespaceObject
Returns class variables defined in this namespace.
#dynamic ⇒ Boolean Originally defined in class Base
Marks whether or not the method is conditionally defined at runtime
#files ⇒ Array<String> (readonly) Originally defined in class Base
The files the object was defined in. To add a file, use #add_file.
#groups ⇒ Array<String> Originally defined in class NamespaceObject
Returns a list of ordered group names inside the namespace
#included_constants ⇒ Array<ConstantObject> Originally defined in class NamespaceObject
Returns constants included from any mixins
#included_meths(opts = {}) ⇒ Object Originally defined in class NamespaceObject
Returns methods included from any mixins that match the attributes
specified by opts
. If no options are specified, returns all
included methods.
#instance_attributes ⇒ Hash Originally defined in class NamespaceObject
Only the instance attributes
#instance_mixins ⇒ Array<ModuleObject> (readonly) Originally defined in class NamespaceObject
Instance mixins
#meths(opts = {}) ⇒ Array<MethodObject> Originally defined in class NamespaceObject
Returns all methods that match the attributes specified by
opts
. If no options are provided, returns all methods.
#mixins(*scopes) ⇒ Array<ModuleObject> Originally defined in class NamespaceObject
Returns for specific scopes. If no scopes are provided, returns all mixins.
#namespace ⇒ NamespaceObject Also known as: parent Originally defined in class Base
The namespace the object is defined in. If the object is in the top level namespace, this is Registry.root
#signature ⇒ String Originally defined in class Base
The one line signature representing an object. For a method, this will be of the form “def meth(arguments…)”. This is usually the first source line.
#source_type ⇒ Symbol Originally defined in class Base
Language of the source code associated with the object. Defaults to
:ruby
.
#visibility ⇒ Symbol Originally defined in class Base
Returns the visibility of an object (:public, :private, :protected)
Instance Method Details
#inheritance_tree(include_mods = false) ⇒ Array<NamespaceObject>
Returns the inheritance tree of mixins.
9 10 11 12 13 14 15 16 |
# File 'lib/yard/code_objects/module_object.rb', line 9 def inheritance_tree(include_mods = false) return [self] unless include_mods [self] + mixins(:instance, :class).map do |m| next if m == self next m unless m.respond_to?(:inheritance_tree) m.inheritance_tree(true) end.compact.flatten.uniq end |