Tools for generating a versioned documentation site from YARD docs.
Object representing a Ruby namespace.
Each namespace can define the following elements:
In most cases, there should be one documented namespace, reflecting the top-level namespace, and in most cases should only include defined classes and/or modules. Top-level constants may be required on a case-by-case basis.
All other namespace properties (attributes and methods) should be reserved for classes and modules, whose representation inherits from NamespaceObject.
SleepingKingStudios::Docs::Data::ModuleObject, SleepingKingStudios::Docs::Data::RootObject
#initialize(native:) => Base
#as_json => Hash{String => Object}
Generates a JSON-compatible representation of the namespace.
Returns a Hash with the following keys:
Additionally, the returned Hash will conditionally include the following keys, if the namespace defines at least one of the corresponding code objects.
#class_attributes => Array<Hash>
Finds the class attributes defined for the namespace.
For each class attribute, it returns a Hash with the following keys:
#class_methods => Array<Hash{String => String}>
Finds the class methods defined for the namespace.
For each method, it returns a Hash with the following keys:
=' or
?’.#constants => Array<String>
Finds the names of the constants defined under this namespace.
#defined_classes => Array<Hash>
Finds the Classes defined under this namespace, if any.
For each defined Class, it returns a Hash with the following keys:
# Given a class LaunchWindow in the namespace Space::Operations:
namespace.name
#=> 'Space::Operations'
namespace.defined_classes
#=> [{ 'name' => 'LaunchWindow', 'slug' => 'launch-window' }]
#defined_modules => Array<Hash>
Finds the Modules defined under this namespace, if any.
For each defined Module, it returns a Hash with the following keys:
# Given a class FuelConsumer in the namespace Space::Engineering:
namespace.name
#=> 'Space::Engineering'
namespace.defined_classes
#=> [{ 'name' => 'FuelConsumer', 'slug' => 'fuel-consumer' }]
#instance_attributes => Array<Hash>
Finds the instance attributes defined for the namespace.
For each instance attribute, it returns a Hash with the following keys:
#instance_methods => Array<Hash{String => String}>
Finds the instance methods defined for the namespace.
For each method, it returns a Hash with the following keys:
=' or
?’.#name => String
The full, qualified name of the namespace.
For the root namespace, should return an empty string. For a Class or a Module, should return the full name, e.g. “MyGem::MyModule::MyClass”.
#slug => String
The name of the namespace in url-safe format.
#type => String
Back to Documentation | Versions | 0.2 | Reference | SleepingKingStudios | SleepingKingStudios::Docs | SleepingKingStudios::Docs::Data