123456789_123456789_123456789_123456789_123456789_

Class: YARD::CodeObjects::RootObject

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: YARD::CodeObjects::ModuleObject
Defined in: lib/yard/code_objects/root_object.rb

Overview

Represents the root namespace object (the invisible Ruby module that holds all top level modules, class and other objects).

Class Method Summary

NamespaceObject - Inherited

.new

Creates a new namespace object inside namespace with name.

Base - Inherited

.===

Compares the class with subclasses.

.new

Allocates a new code object.

Instance Attribute Summary

NamespaceObject - Inherited

#aliases

A hash containing two keys, :class and :instance, each containing a hash of objects and their alias names.

#attributes

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.

#children

The list of objects defined in this namespace.

#class_mixins

Class mixins.

#groups,
#instance_mixins

Instance mixins.

Base - Inherited

#base_docstring

The non-localized documentation string associated with the object.

#dynamic

Marks whether or not the method is conditionally defined at runtime.

#dynamic?

Is the object defined conditionally at runtime?

#files

The files the object was defined in.

#group,
#namespace

The namespace the object is defined in.

#namespace=

Sets the namespace the object is defined in.

#parent

Alias for Base#namespace.

#root?,
#signature

The one line signature representing an object.

#source

The source code associated with the object.

#source=

Attaches source code to a code object with an optional file location.

#source_type

Language of the source code associated with the object.

#visibility, #visibility=

Instance Method Summary

ModuleObject - Inherited

#inheritance_tree

Returns the inheritance tree of mixins.

NamespaceObject - Inherited

#child

Looks for a child that matches the attributes specified by opts.

#class_attributes

Only the class attributes.

#constants

Returns all constants in the namespace.

#cvars

Returns class variables defined in this namespace.

#included_constants

Returns constants included from any mixins.

#included_meths

Returns methods included from any mixins that match the attributes specified by opts.

#instance_attributes

Only the instance attributes.

#meths

Returns all methods that match the attributes specified by opts.

#mixins

Returns for specific scopes.

Base - Inherited

#==

Alias for Base#equal?.

#[]

Accesses a custom attribute on the object.

#[]=

Sets a custom attribute on the object.

#add_file

Associates a file with a code object, optionally adding the line where it was defined.

#add_tag

Add tags to the #docstring

#copy_to

Copies all data in this object to another code object, except for uniquely identifying information (path, namespace, name, scope).

#docstring

The documentation string associated with the object.

#docstring=

Attaches a docstring to a code object by parsing the comments attached to the statement and filling the #tags and #docstring methods with the parsed information.

#eql?

Alias for Base#equal?.

#equal?

Tests if another object is equal to this, including a proxy.

#file

Returns the filename the object was first parsed at, taking definitions with docstrings first.

#format

Renders the object using the templating system.

#has_tag?

Tests if the #docstring has a tag.

#hash,
#initialize

Creates a new code object.

#inspect

Inspects the object, returning the type and path.

#line

Returns the line the object was first parsed at (or nil).

#method_missing,
#name

The name of the object.

#path

Represents the unique path of the object.

#relative_path,
#sep

Override this method with a custom component separator.

#tag

Gets a tag from the #docstring

#tags

Gets a list of tags from the #docstring

#title, #to_ary,
#to_s

Alias for Base#path.

#type

Default type is the lowercase class name without the "Object" suffix.

#format_source

Formats source code by removing leading indentation.

#translate_docstring

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

#root?Boolean (readonly)

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 9

def root?; true end

Instance Method Details

#equal?(other) ⇒ Boolean

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 12

def equal?(other)
  other == :root ? true : super(other)
end

#hash

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 16

def hash; :root.hash end

#inspect

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 8

def inspect; @inspect ||= "#<yardoc root>" end

#path

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 7

def path; @path ||= "" end

#title

[ GitHub ]

  
# File 'lib/yard/code_objects/root_object.rb', line 10

def title; 'Top Level Namespace' end