Docs

Tools for generating a versioned documentation site from YARD docs.

Class: SleepingKingStudios::Docs::Data::ClassObject

Parent Namespace
SleepingKingStudios::Docs::Data
Inherited Classes
SleepingKingStudios::Docs::Data::ModuleObject > SleepingKingStudios::Docs::Data::NamespaceObject > SleepingKingStudios::Docs::Data::Base > Object
Defined In
lib/sleeping_king_studios/docs/data/class_object.rb

Table Of Contents

Overview

Object representing a Ruby class.

Each class can define the following elements:

Additionally, a class can have a description and metadata tags.

See Also

Back To Top

Constructor

#initialize(native:) => Base

Inherited From
SleepingKingStudios::Docs::Data::Base

Parameters

Returns

Back To Top

Instance Methods

#as_json => Hash{String => Object}

Generates a JSON-compatible representation of the module.

Returns a Hash with the following keys:

Additionally, the returned Hash will conditionally include the following keys, if the module defines at least one of the corresponding code objects.

Returns

#class_attributes => Array<Hash>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the class attributes defined for the namespace.

For each class attribute, it returns a Hash with the following keys:

Returns

#class_methods => Array<Hash{String => String}>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the class methods defined for the namespace.

For each method, it returns a Hash with the following keys:

Returns

#constants => Array<String>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the names of the constants defined under this namespace.

Returns

#constructor? => Boolean

Returns

#data_path => String

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

The path to the data file.

Returns

#defined_classes => Array<Hash>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the Classes defined under this namespace, if any.

For each defined Class, it returns a Hash with the following keys:

Examples

# Given a class LaunchWindow in the namespace Space::Operations:
namespace.name
#=> 'Space::Operations'
namespace.defined_classes
#=> [{ 'name' => 'LaunchWindow', 'slug' => 'launch-window' }]

Returns

#defined_modules => Array<Hash>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the Modules defined under this namespace, if any.

For each defined Module, it returns a Hash with the following keys:

Examples

# Given a class FuelConsumer in the namespace Space::Engineering:
namespace.name
#=> 'Space::Engineering'
namespace.defined_classes
#=> [{ 'name' => 'FuelConsumer', 'slug' => 'fuel-consumer' }]

Returns

#description => String

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

The full description of the module, minus the first clause.

The remainder of the module description, if any, after subtracting the short description (separated by the first paragraph break).

Returns

See Also

#direct_subclasses => Array<Hash{String => String}>

A list of the direct subclasses of the class.

For each subclass, it returns a Hash with the following keys:

Returns

#extended_modules => Array<Hash{String => String}>

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

A list of the modules that extend the original module.

For each extending Module, it returns a Hash with the following keys:

Returns

#files => Array<String>

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

A list of the files where the module is defined.

Returns

#included_modules => Array<Hash{String => String}>

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

A list of the modules that are included in the original module.

For each included Module, it returns a Hash with the following keys:

Returns

#inherited_classes => Array<Hash{String => String}>

A list of the classes that are inherited by the class.

For each inherited Class, it returns a Hash with the following keys:

Returns

#instance_attributes => Array<Hash>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the instance attributes defined for the namespace.

For each instance attribute, it returns a Hash with the following keys:

Returns

#instance_methods => Array<Hash{String => String}>

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

Finds the instance methods defined for the namespace.

For each method, it returns a Hash with the following keys:

Returns

#metadata => Object

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

Additional metadata tags from the documentation.

See Also

#name => String

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

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”.

Returns

#parent_path => String

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

The path to the defining class or module’s data file.

Returns

#short_description => String

Inherited From
SleepingKingStudios::Docs::Data::ModuleObject

A short description of the module.

The first part of the module description, separated by the first paragraph break. Typically should fit on a single line of text.

Returns

See Also

#slug => String

Inherited From
SleepingKingStudios::Docs::Data::NamespaceObject

The name of the namespace in url-safe format.

Returns

#type => String

Returns

Back To Top


Back to Documentation | Versions | 0.2 | Reference | SleepingKingStudios | SleepingKingStudios::Docs | SleepingKingStudios::Docs::Data